Get the App
SLTechnology News&Howtos  ›  Database  › 

Several minor problems encountered in compiling MYSQL with source code

Shulou Source: shulou.com Published: 2022-06-01 16:53:01 10月03日 Update

Free to bored, conveniently practice for a long time did not touch MYSQL, so decided to compile the source code installation MYSQL-5.7.11, practice not tight, out of a lot of problems, so quickly summarized here:

First download compiler: cmake-2.8.12.2-4.el6.x86_64.rpm MYSQL source package: mysql-boost-5.7.11.tar.gz

Next, configure, compile and install the trilogy: (The difference is that I put the data directory on a separate virtual hard disk-DMYSQL_DATADIR=/mydata/data -DMYSQL_UNIX_DATA=/mydata/data/mysql.sock to separate the data and installation paths, and the socket directory is also defined on the data directory)

The first problem: the virtual machine to the memory is not enough (850M), the compilation was particularly slow, basically compiled to 70% when it will not pass, so the solution is to increase the memory to 3000M, while adding a CPU to the virtual machine to speed up the compilation.

The second question: I thought this would be able to compile smoothly, but when compiling, there is still no past, and the consistency card is at 70%. Why? Little buddy door, can you guess why?

The answer is: My disk memory is not enough, run out, use df -h to view, I go, the disk has burst, so the next hurry to stretch the disk, directly pull to 15G is almost, when stretching note is that when the lv is expanded to 15G, be sure to remember to expand the file system (resize2fs /dev/Vogroup/lv_root), otherwise the file system still does not get the purpose of stretching.

Third question: So I waited quietly for the installation to succeed, um, finally it did succeed. Haha, then create mysql users and mysql user groups, and change all files in/usr/local/mysql to mysql.mysdl users and groups, and then initialize mysql database, so that mysql database is established, used to store metadata of mysql database, just like file system metadata stored in metadata area (innode), and information_schema database is used to store some data generated during database operation.

At the end of initialization, the file in the data directory/mydata/data is changed to chown mysql.mysql . -R All changed to mysql users and groups. So finally start the data server (/etc/init.d/mysqld start(the previous environment variables have been changed, and the startup scripts mysql.server and my.cnf have been copied from supports-file to/etc/init.d/mysqld and/etc/my.cnf respectively)). The service is started, but the problem appears:

Error: Can't connect to local MySQL server through socket '/mydata/data' (111)

This question puzzles me for nearly half an hour, so all kinds of Baidu A, at the moment I miss Google A, the emperor no longer has a heart, I still find the answer;

The question is: I did not define socket addresses for [mysqld] and [client] in the main configuration file, and mysql default address is/var/lib/mysql, so quickly:[client] socket= /mydata/data/mysql.sock [mysqld] socket= /mydata/data/mysql.sock restart mysqld server again, at this time in/mydata/there are sockets generated, and can also connect to mysqld main server through local mysql client.

Tags: Data compilation problems files databases services sockets that is server user directory memory disk system or source code success next not enough address Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft vpn NVidia Shulou Tech Info Xiaomi