Operating system: Red Hat Enterprise Linux Server Release 6.5
MySQL installation package: mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz
1. Create MySQL group and MySQL user in Linux
[Email protected] ~]# groupadd-g MySQL
[Email protected] ~]# useradd mysql-g mysql-p MySQL
2. Upload the installation package to the/usr/local directory
---upload process slightly---
3. Unzip the installation package
[Email protected] local]# TAR-ZXVF mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz
4. Change the installation package name to ' MySQL ' after unpacking
[[Email protected] local]# mv mysql-5.6.34-linux-glibc2.5-x86_64 MySQL
5. Authorization: The extracted document belongs to the main group and changed to Root:root, where data is changed to Mysql:mysql
[Email protected] ~]# Cd/usr/local/mysql
[Email protected] mysql]# chown Root:root *
[Email protected] mysql]# chown mysql:mysql data
[email protected] mysql]# LL
Total 68
Drwxr-xr-x. 2 root root 4096 Jan 9 22:26 Bin
-rw-r--r--. 1 root root 17987 Sep 19:41 COPYING
Drwxr-xr-x. 3 MySQL mysql 4096 Jan 9 22:26 data
Drwxr-xr-x. 2 root root 4096 Jan 9 22:26 Docs
Drwxr-xr-x. 3 root root 4096 Jan 9 22:26 include
Drwxr-xr-x. 3 root root 4096 Jan 9 22:26 Lib
Drwxr-xr-x. 4 root root 4096 Jan 9 22:26 man
Drwxr-xr-x. Root root 4096 Jan 9 22:26 mysql-test
-rw-r--r--. 1 root root 2496 Sep 19:41 README
Drwxr-xr-x. 2 root root 4096 Jan 9 22:26 scripts
Drwxr-xr-x. Root root 4096 Jan 9 22:26 Share
Drwxr-xr-x. 4 root root 4096 Jan 9 22:26 sql-bench
Drwxr-xr-x. 2 root root 4096 Jan 9 22:26 support-files
6. Initialize the Authorization form
[Email protected] ~]# Cd/usr/local/mysql
[Email protected] mysql]# scripts/mysql_install_db--user=mysql--datadir=/usr/local/mysql/data
7. Edit the configuration file
[Email protected] ~]# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF
[Email protected] ~]# VI/ETC/MY.CNF
---Modify the following content---
Basedir =/usr/local/mysql
DataDir =/usr/local/mysql/data
Port = 3306
8. Mapping MySQL and Mysqladmin directories
[Email protected] ~]# Cd/usr/local/bin
[Email protected] bin]# ln-fs /usr/local/mysql/bin/mysql MySQL
[Email protected] bin]# ln-fs /usr/local/mysql/bin/mysqladmin mysqladmin
# #标红部分为MySQL的实际安装目录, modified according to the actual directory
9. Copy the Mysql.server boot script to the INIT.D directory
[Email protected] ~]# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql
10. Start MySQL Servier
[[Email protected] bin]# service MySQL start
11. Modify the root user's password
[Email protected] ~]# mysqladmin-uroot password
12. Connect to MySQL Server
[Email protected] bin]# mysql-u root-p
The end!
2017-08-17
"MySQL" Binary distribution installation