Source code compilation MySQL encounter a few small problems

Source: Internet
Author: User
Tags mysql client

Idle to boring, handy practice for a long time did not touch MySQL, so decided to compile the source code installation MYSQL-5.7.11, Practice matter, out a lot of problems, and then hurriedly summed up here:


First downloaded compiler: cmake-2.8.12.2-4.el6.x86_64.rpm mysql source bundle: mysql-boost-5.7.11.tar.gz


Next configure, compile, install 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 implement data and installation paths, and the socket directory is also defined in the data directory)


The first problem: the virtual machine to give insufficient memory (850M), at that time the compiler is particularly slow, basically compiled to 70%, it is difficult to overcome, so the solution is to increase the memory to 3000M, while adding a CPU to the virtual machine to speed up the compilation speed.


The second question: This thought this will be able to successfully compile it, but the compile time or not the past, the same card in 70%, why? Little Buddy Door, did you guess why?

The answer is: My disk memory is not enough, run out, use Df-h to see, I go, the disk has blown up, so the next quick disk stretching, pull directly to the 15G is almost, stretching the note is when the LV enlargement 15G, be sure to remember to extend the file system (RESIZE2FS/ Dev/vogroup/lv_root), otherwise the file system has not been stretched for the purpose.


The third question: In this way I quietly wait for the installation success, Ah Heng, finally did succeed Ha. Haha, then it is new MySQL user and MySQL user group, and will/usr/local/ MySQL files are all changed to mysql.mysdl belong to the user and group, and then initialize the MySQL database, so that the establishment of the MySQL database, to store the MySQL database metadata, and file system metadata stored in the metadata area (Innode), and information The _schema database is used to store some data that is generated when the database is running.

The end of initialization is to change the file inside the data directory to Chown Mysql.mysql./mydata/data. -R all changes to MySQL users and groups. Then finally start the data server (/etc/init.d/mysqld start (the previous environment variables have been changed Oh, and from the Supports-file, the startup script Mysql.server and my.cnf are copied to/etc/init.d/ Mysqld and/ETC/MY.CNF) service was started, but the problem arose:

Cannot connect to MYSQLD server via socket on native Client, error:error:can ' t connect to local MySQL server through socket '/mydata/data ' (111)

This problem bothers me nearly half an hour, so all kinds of Baidu, at the moment I miss Google, Emperor no longer, I still find the answer;

The problem is: I did not define a socket address for [mysqld] and [client] in the main configuration file, and the default address for MySQL is/var/lib/mysql, so hurry: [client] socket=/mydata/data/ Mysql.sock [mysqld] Socket=/mydata/data/mysql.sock again restart the mysqld server, at this time in/mydata/data/also have socket generation, You can also access the Mysqld master server via a local MySQL client connection.

This article from "Foreverlinux" blog, reproduced please contact the author!

Source code compilation MySQL encounter a few small problems

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.