1. Download
: Http://dev.mysql.com/downloads/mysql/5.6.html#downloads
Download version: I choose here 5.6.33, General edition, Linux under 64-bit
You can also directly copy the 64-bit, download by command:
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
2. Installation dependent
#安装依赖yum-y Install perl perl-devel autoconf Libaio
3. Decompression
#解压tar-zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz# Copy the extracted MySQL directory cp-r mysql-5.6.33-linux-glibc2.5-x86_64/usr/ local# renaming MV mysql-5.6.33-linux-glibc2.5-x86_64 MySQL
4. Adding user groups and users
#添加用户组groupadd mysql# Add user MySQL to user group Mysqluseradd-r-G mysql-s/bin/false MYSQLL
5, go to install MySQL software directory, modify the directory owner for the MySQL user
CD Mysql/chown-r Mysql:mysql./
6. Install the database
CD mysql/./scripts/mysql_install_db--user=mysql
7, modify the current directory owner is the root user
Chown-r Root:root./
8. Modify the current data directory owner as a MySQL user
Chown-r Mysql:mysql Data
9. Add MySQL service boot from boot
CP support-files/mysql.server/etc/init.d/mysql# gives executable permissions chmod +x/etc/init.d/mysql# add service chkconfig--add mysql# Show Service list Chkconfig--list
If you see the MySQL service and the 3,4,5 is on, it succeeds if it is off, then executes
Chkconfig--level 345 MySQL on
10. Start the MySQL service
#创建缺少的文件夹mkdir/var/log/mariadbservice MySQL Start
Normal tip information:starting MySQL. Success!
11. Put the MySQL client on the default path
Ln-s/usr/local/mysql/bin/mysql/usr/local/bin/mysql
12. Add MySQL command
# ln-s/usr/local/mysql/bin/mysql/usr/bin
13. Log in to MySQL
# Mysql-uroot-proot
======================= to this database installation ===========================================
CentOS7 installing MySQL on a virtual machine