Manually compile and install MySQL

Source: Internet
Author: User

1, download http://dev.mysql.com/downloads/mysql/with boost Generic Linux version on official website

2, install dependent Library, yum install cmake git gcc gcc-c++ ncurses ncurses-devel-y

3, use CMake in the source file. -dcmake_install_prefix=/usr/local/mysql-dsysconfdir=/etc-ddefault_charset=utf8-ddefault_collation=utf8_general _ci-dmysql_datadir=/usr/local/mysql/data-dwith_boost=boost detection, generate makefile file, this step is very important, because I have eaten on this, permissions issues, if it is a normal user, Create a good folder in advance

/usr/local/mysql/, ordinary users must change the permissions, Chown xxoo:xxoo/usr/local/mysql/, and then execute the command just now.

4,make && make install (note not sudo make install);

5, if there is no error, open the/usr/local/mysql/support-files/folder, sudo cp my-default.cnf/etc/my.cnf open my.cnf Modify the parameters, put the previous comment out to join

[Client]
Port = 1278
Socket =/usr/local/mysql/data/mysql.sock

[Mysqld]
Port = 1278
Socket =/usr/local/mysql/data/mysql.sock
Basedir =/usr/local/mysql
DataDir =/usr/local/mysql/data

Then remember to modify the permissions, Chown xxoo:xxoo/etc/my.cnf

6, in the/usr/local/mysql/bin directory, use the./mysqld--initialize--user=xxoo--basedir=/usr/local/mysql--datadir=/usr/local/ Mysql/data

Will generate a password, be sure to remember!

7. Open the Mysqd_safe in the bin directory to open another shell window, execute mysql-u root-p Enter

Enter the original password and change the password: ALTER user user () identified by ' xxxxxx '; It's OK!

8. Open the Mysqld_server file in the Support-files file CP to/ETC/INIT.D/MYSQLD using Chkconfig mysqld on.

9, use service mysqld start to open the MySQL process;

Manually compile and install MySQL

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.