1. Establish operating system users and groups
[[email protected] ~]# Groupadd MySQL
[[email protected] ~]# useradd-g MySQL MySQL
2, unzip the installation files, into the decompression directory:
[Email protected] mnt]# TAR-ZXVF mysql-5.0.15.tar.gz
[Email protected] mnt]# CD mysql-5.0.15
3. Compile and install MySQL source files:
[Email protected] mysql-5.0.15]#/configure--prefix=/usr/local/mysql5015
[[email protected] mysql-5.0.15]# make && make install
4. Edit the MySQL configuration file
[Email protected] mysql]# pwd
/usr/local/mysql5015/share/mysql
[email protected] mysql]# CP my-medium.cnf/etc/my.cnf
5, initialize the MySQL database (in the data directory to create the system database and system tables,--user that these databases and tables owner is this user):
[Email protected] mysql5015]# bin/mysql_install_db--user=mysql
6. Set Directory Permissions:
[Email protected] mysql5015]# chown-r mysql:mysql. /mysql5015/
7. Start MySQL
[Email protected] mysql]# Bin/mysqld_safe--user=mysql &
[[email protected] ~]# ps-ef|grep MySQL
Root 8654 26893 0 13:09 pts/4 00:00:00/bin/sh bin/mysqld_safe--user=mysql
MySQL 10787 8654 1 13:10 pts/4 00:00:00/usr/local/mysql5015/libexec/mysqld--basedir=/usr/local/mysql5015--datad Ir=/usr/local/mysql5015/var--user=mysql--pid-file=/usr/local/mysql5015/var/faspdev.pid--skip-locking--port= 3306--socket=/tmp/mysql.sock
MySQL source code installation method on Linux (Configure)