1. Upload the MySQL installation package "mysql-5.5.40-linux2.6-x86_64.tar.gz" to the deployment machine, any location;
2. Extract the MySQL installation package to the directory where it is located, with the following command:
tar -zxvf mysql-5.5. -linux2. 6-x86_64. tar. gz
3. Copy the extracted directory to the system's local software directory "/usr/local/", the command is as follows:
CP -RF mysql-5.5. -linux2. 6-x86_64 /usr/local/mysql
4. Add the MySQL user group and the MySQL user with the following command:
-r-g MySQL MySQL
5. Go to the directory where the MySQL software is installed and command the following:
Cd/usr/local/mysql
6. Modify the current directory owner for the newly created MySQL user, with the following command:
chown -R mysql:mysql./
7. Copy the default global boot parameter profile to the/etc directory with the following command:
CP ./SUPPORT-FILES/MY-MEDIUM.CNF /etc/my.cnf
8. Execute the installation package with the script, install the database, the command is as follows:
./scripts/mysql_install_db--user=mysql
9. Modify the current directory owner to be the root user, the command is as follows:
chown -R root:root./
10. Modify the data directory owner to be a MySQL user with the following command:
chown -R mysql:mysql Data
This completes the database installation and is verified below.
11. Modify the/etc/my.cnf file. Modify the character set of the database and make it "case insensitive".
Add under [client]:
Default-character-set=utf8
[Mysqld] under Add:
character-set-server=Utf8lower_case_table_names=1
[MySQL] under Add:
Default-character-set=utf8
12. Start the MySQL database, note: It needs to be executed with root, the command is as follows:
sudo /usr/local/mysql/support-files/mysql.server start
To see if the MySQL process has started, the command is as follows:
PS -ef| grep MySQL
Displays the results as shown, indicating that the MySQL database started successfully:
13. Modify the password of the root user of the MySQL database, the initial password for root is empty by default, and the command is as follows:
' fill in the password here '
MySQL Database installation (CentOS OS/tar.gz mode)