1. First, install the package mysql-5.1.28-rc.tar.gz for wget mysql, compile with configure before version 5.1, and compile with cmake for Versions later than version 5.1.
Extract mysql-5.1.28-rc.tar.gz
Tar-axvf mysql-5.1.28-rc.tar.gz
2. Enter the decompressed folder cd mysql-5.1.28-rc
3. Compile $./configure -- prefix =/* directory to be installed/mysql -- with-charset = utf8 -- with-plugins = innobase
Example: $./configure -- prefix = $ HOME/mysql -- with-charset = utf8 -- with-plugins = innobase
** ===================================================== ============== **
How to solve the problem of configure: error: No curses/termcap library found during Mysql Compilation
It indicates that the curses/termcap library is not installed.
Root install ncurses (or compile and install ncurses, And then./configure during compilation -- with specifies the lib path)
** ===================================================== ============== **
4. $ make
$ Make install
5. Copy a configuration file to the mysql installation directory and rename it my. cnf.
Find the my-medium.cnf Under share/mysql/Under the installation directory, copy it to the installation directory and rename it to my. cnf
6. Modify the my. cnf File
Socket =/*** directory to be installed/mysql. sock (the default value is/tmp/mysql. sock because we are common users and cannot operate/tmp/, mysql. the sock file is automatically generated when mysql is started. Pay attention to the log information during startup. If an error is reported, check the error log in the var directory under the mysql installation directory to find the cause)
Basedir =/installation path/mysql
Datadir =/installation path/mysql/var
7. initialize database tables
Installation directory/bin/mysql_install_db -- user = mysql -- datadir =/installation path/mysql/var
Example: $./mysql/bin/mysql_install_db -- user = mysql -- datadir = $ HOME/mysql/var
8. Start the mysql Service
/Installation path/bin/mysqld_safe -- defaults-file =/installation path/my. cnf
Example: $./mysql/bin/mysqld_safe -- defaults-file = $ HOME/mysql/my. cnf
9. Enter the mysql database
/Installation path/bin/mysql-S/installation path/mysql. sock
For example, $./mysql/bin/mysql-S $ HOME/mysql. sock or
./Mysql/bin/mysql-h '2017. 0.0.1 '-u root-p
10. Modify the root user password
$./Mysql/bin/mysqladmin-h '2017. 0.0.1 '-u root password 127