1. download the relevant package (the source package must be used)
Mysql-5.0.22.tar.gz
Ii. Run configure
. /Configure -- prefix =/data1/zhangsc/local/mysql -- with-mysqld-user = zhsc -- with-unix-socket-path =/data1/zhangsc/local/mysql. sock -- localstatedir =/data1/zhangsc/local/mysql/data -- enable-consumer er -- with-mysqld-ldflags =-all-static -- with-low-memory -- with-mit- threads
3. Perform make and make install based on previous steps to install the source code package
4. Compile the my. cnf file with the following content:
[Mysqld]
# Database path. The content can be copied from a running database.
Datadir =/data1/zhangsc/local/mysql/data
# Pipeline file: Specifies the path of the pipeline file, which is consistent with the configuration in configure during installation
Socket =/data1/zhangsc/local/mysql. sock
# Default to using old password format for compatibility with mysql 3.x
# Clients (those using the mysqlclient10 compatibility package ).
Old_passwords = 1
[Mysql. server]
User = mysql
# Mysql database path
Basedir =/data1/zhangsc/local/mysql/lib/mysql
[Mysqld_safe]
# Mysql Error Log Path
Err-log =/data1/zhangsc/local/mysql/log/mysqld. log
# Mysql's pid path can be used wherever possible, as long as you have Access Permissions
Pid-file =/data1/zhangsc/local/mysql/mysqld. pid
5. Start the database server:
Enter the bin path of mysql and run the program:./mysqld_safe -- defaults-file = my. cnf