1. Newly opened cloud server, need to detect whether the system comes with the installation of MySQL
# yum list installed | grep mysql
2. If you find a system that comes with MySQL, do it decisively
# yum -y remove mysql-libs.x86_64
3. Wherever you store files in the directory to execute, here to explain, because this MySQL source servers in the server abroad, so download speed will be relatively slow, fortunately mysql5.6 only 79M big, and mysql5.7 182M, so this is I do not want to install mysql5.7 reason
# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
4. Then execute this sentence and explain that this rpm is not a MySQL installation file, just two yum source files, executed after the/etc/yum.repos.d/ This directory has more Mysql-community-source.repo and Mysql-community.repo
rpm -ivh mysql-community-release-el6-5.noarch.rpm
5. At this time, you can use the Yum repolist mysql command to see if you already have MySQL installable files
all | grep mysql
6. Install the MySQL server command (yes):
# yum install mysql-community-server
7. After successful installation
# service mysqld start
8. Since MySQL has just been installed, the root password of MySQL is empty by default, so we need to log in in time with the root user of MySQL (first enter, no password), and change the password
update user set password=PASSWORD("这里输入root用户密码") where User=‘root‘;
9. License (automatically create) a MySQL non-root AAA user, can access the TestDB database on localhost, the password is XXXX, and finally refresh the permissions
on testdb.* to [email protected] identified by ‘xxxx‘;# flush privileges;
10. Create a UTF8 table (if you need one) and then exit
CREATE DATABASE `database` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; # exit;
11. Check if MySQL is self-booting and set the self-start command
# chkconfig --list | grep mysqld# chkconfig mysqld on
12.mysql security settings (the system will ask you a few questions, can not understand the translation after the copy, basically all the way Yes):
# mysql_secure_installation
13. Good night.
# exit
Centos 6.8 Installation mysql5.6