Download the installation files ready.
Https://dev.mysql.com/downloads/mysql/5.6.html#downloads
Install the Rzsz upload feature using Yum-y installation Lrzsz.
Unzip the file to/usr/local/named MySQL
[Email protected] ~]# tar XF mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz-c/usr/local
[Email protected] ~]# cd/usr/local
2. Create a connection to connect the extracted files to MySQL
[Email protected] local]# LN-SV mysql-5.6.33-linux-glibc2.5-x86_64/mysql
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/8E/9A/wKiom1jGhb-QZGd_AABBtyNWuhA519.jpg "title=" Qq20170313194129.jpg "alt=" Wkiom1jghb-qzgd_aabbtynwuha519.jpg "/>
3. Create a user group:
Create MYSQ1 user, group
#groupadd-R-G 306 MySQL
#useradd-G 306-r-u 306 mysql
ID MySQL View permissions
650) this.width=650; "src=" https://s3.51cto.com/wyfs02/M01/8E/9A/wKiom1jGhrfQdS1WAAAwpiQATZM689.jpg "title=" 2.jpg "alt=" Wkiom1jghrfqds1waaawpiqatzm689.jpg "/>
Change the MySQL directory for all files that belong to the group master
#chown-R mysql.mysql/usr/local/mysql/*
Use the command ll to view
650) this.width=650; "src=" https://s1.51cto.com/wyfs02/M02/8E/99/wKioL1jGh17wXncNAAC7LOcqHH0720.jpg "title=" 3.jpg "alt=" Wkiol1jgh17wxncnaac7locqhh0720.jpg "/>
Create a new Folder
#mkdir-P/mydata/data
Change the folder that belongs to the group master
#chown-R mysql.mysql/mydata/data/
change user Permissions
#chmod o-rx/mydata/data/
Verify permissions: ls-ld/mydata/data/
650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M01/8E/9A/wKiom1jGh_-SD-Y8AABIb6OtUEs617.jpg "title=" 4.jpg "alt=" Wkiom1jgh_-sd-y8aabib6otues617.jpg "/>
Initializing the database
Execute in MySQL directory
[Email protected] mysql]# scripts/mysql_install_db--user=mysql--datadir=/mydata/data/
650) this.width=650; "src=" https://s5.51cto.com/wyfs02/M02/8E/A3/wKioL1jHo9Lgzn8SAADfo-o-tpk920.jpg "title=" 9.jpg "alt=" Wkiol1jho9lgzn8saadfo-o-tpk920.jpg "/>
For security, after initialization is complete, change the group of MySQL directories to root
Chown-r root/usr/local/mysql/*
Copy the startup script to/etc/init.d/named Mysqld
Execute the command in the MySQL directory:
[email protected] mysql]# CP support-files/mysql.server/etc/init.d/mysqld
Join the Service list:
[Email protected] mysql]# chkconfig--add mysqld
[Email protected] mysql]# chkconfig--list mysqld
Mysqld 0:off1:off2:on3:on4:on5:on6:off
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/8E/A5/wKiom1jHpDWxuZFgAABEhixLW3k712.jpg "title=" 10. JPG "alt=" wkiom1jhpdwxuzfgaabehixlw3k712.jpg "/>
Note:
MySQL configuration file load path
/ETC/MY.CNF-->/etc/mysql/my.cnf-$BASEDIR/my.cnf-~/.my.cnf
If you configure a conflict, whichever is the last, the last one will overwrite the previous
---------------------------------------------------------------------------------------
You must complete the following steps or you cannot start :
Copy the configuration file under the/usr/local/mysql file directory to/etc/under rename My.cnf
[email protected] mysql]# CP support-files/my-default.cnf/etc/my.cnf
Open a file with vim
#vim/etc/my.cnf
Add definition data File storage path
#datadir =/mydata/data
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/8E/A5/wKiom1jHpOazZ0JHAADOGyUUhms338.jpg "title=" 11. JPG "alt=" wkiom1jhpoazz0jhaadogyuuhms338.jpg "/>
Enable MySQL with service mysqld start
Startup success:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/8E/A5/wKiom1jHpUfwhKZVAACE5_XtOzo007.jpg "title=" 12. JPG "alt=" wkiom1jhpufwhkzvaace5_xtozo007.jpg "/>
Log in to MySQL database: [[email protected] mysql]# mysql-uroot-p
Password is empty direct Enter confirmation
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/8E/A6/wKiom1jHwTKgqoSTAABlak0dW-0323.jpg "title=" 13. JPG "alt=" wkiom1jhwtkgqostaablak0dw-0323.jpg "/>
At this point, the mysql5.6 version of the compilation installation is complete!
This article is from the "CENTOS6 use Xtrabackup" blog, be sure to keep this source http://9052426.blog.51cto.com/9042426/1906492
centos+mysql5.6