This article mainly describes how to useSource codeTo install MYSQL:
Download the MySQL source code package and place it in/usr/local/src. Assume that my source code package is mysql.5.1.tar.gz.
Create a user group and a user
Groupadd MySQL // create a MySQL user group
Useradd-G MySQL // create a MySQL account
Start installation below:
1. decompress the source code package
Tar-zxvf mysql.5.1.tar.gz
2. Go to the extract package.
Install the software trilogy: Configure, make, make install
./Configure -- prefix =/usr/local/MySQL-with-charset = GBK
Make clean; make (where make clean can not be, it is best to bring it)
Make install
3. CP support-files/my-medium.cnf/etc/My. CNF // copy the my-medium.cnf file to the/etc/directory and rename it my. CNF
4. Open the my. CNF file in the editor, find the log-bin = mysql-bin line, and comment it out.
: # Log-bin = mysql-bin
5. Go to the installation directory:
Bin/mysql_install_db -- user = MySQL
6. Set Directory Permissions
Chown-r root. // Set directory permission attributes
Chown-r MySQL/usr/local/MySQL/var
Chgrp-r MySQL.
Bin/mysqld_safe -- user = MySQL & // start MySQL
7. Add/usr/local/MySQL/bin to the environment variable.
8. Run mysql-uroot. If the logon succeeds, the installation is successful.