As the author of the current Centos7 already integrated mariadb default, so before you install mysql need to rely mariadb installation package to uninstall, or will affect the subsequent installation of mysql.
(Note: If your system is not installed mariadb, steps 1 and 2 can be ignored)
1. Find mariadb already installed
# rpm -qa | grep mariadb
2. Uninstall mariadb installation package
# rpm -e mariadb-libs-5.5.60-1.el7_5.x86_64 # rpm -e --nodeps mariadb-libs
3. Download the mysql yum source
# wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
4. List yum source warehouse has keywords mysql to see if there are downloads
# yum repolist all | grep mysql
Identify all case-insensitive letters mysql installation package
rpm -qa | grep -i mysql
5. Installation source mysql
# yum -y localinstall mysql57-community-release-el7-11.noarch.rpm # yum repolist all | grep mysql //发现已经安装了mysql源
6. Install mysql
# yum install mysql-community-server
7. Set the boot mysql service
# systemctl enable mysqld
8. Start mysql service
# systemctl start mysqld
9. Since the password is automatically generated after installation will need to enter a password known only to the following command
# grep 'temporary password' /var/log/mysqld.log
10. Log mysql
mysql -uroot -p
Step 8 after use to log password, the input
11. Reset Password
mysql> set password for 'root'@'localhost'=password('JonySuper@666');
The password must be eight or more, containing both uppercase and lowercase letters and numbers, special characters, otherwise it will error:
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
12. Restart the mysql service
# systemctl restart mysqld
13. re-entering the mysql login
# mysql -uroot -p
Step 9 is different, the password input is already set up their own, it should be an example to my input is JonySuper @ 666
Then you can operate the database ~
Note: This article is Jony original, without permission shall not be reproduced in any platform Rights Reserved. For reprint, may be concerned about micro-channel public number: Technical training camp, the message in the background, contact the author to obtain permission to reprint ~