I. Basic installation
$ Tar zxvf mysql-3.23.58.tar.gz
$ Mysql-3.23.58 cd
$./Configure -- prefix =/usr/local/mysql -- sysconfdir =/etc -- localstatedir =/var/lib/mysql
$ Make
$ Make install
# Prefix =/usr/local/mysql target directory for mysql Installation
# Sysconfdir =/etc my. ini configuration file path
# Localstatedir =/var/lib/mysql database storage path
2. Create mysql user groups and users and set Access Permissions
$ Groupadd mysql
$ Useradd-g mysql # Add a mysql user to the mysql user group
After creating user groups and users, switch to the/usr/local/mysql directory.
$ Cd/usr/local/mysql
Change the access permission of the mysql directory
$ Chown-R mysql. #. indicates the mysql directory and all files and directories in the directory.
Initialize the database after installation. You do not need to perform this step if you upgrade the database;
$/Usr/local/mysql/bin/mysql_install_db
$/Usr/local/mysql/bin/safe_mysqld &
OK. Check if mysql works properly.
Mysql-u root mysql
Generally, the database cannot be connected normally. The error message is:
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql. sock' (2)
After completing the above steps, COPY a script in your compiled directory
Cp support-files/mysql. server/etc/rc. d/init. d/mysqld
Chkconfig -- add mysqld
Set ntsysv to enable mysql to run automatically at each startup.
Now that mysql is installed, you can start your mysql service.
/Etc/rc. d/init. d/mysqld start