Preparing the Environment
- Uninstall mariadb
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
-
Installing MySQL
-
Get yum source (MySQL official website)
-
Yum install source
rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
-
View the status of each version of the boot
yum repolist all | grep mysql
The latest version 8.0 is enabled by default
-
Disable 8.0 5.7 open
yum-config-manager --disable mysql80-community yum-config-manager --enable mysql57-community
Command yum-utils package, install either can not be found to solve the yum-config-manager command:
yum -y install yum-utils
-
Installation mysqll
yum -y install mysql-community-server
-
Configure MySQL remote connections
-
Check mysql version
mysql -V
-
Start mysql && set the boot from Kai
systemctl start mysqld systemctl enable mysqld
-
View the default password generation
grep 'temporary password' /var/log/mysqld.log
-
Login Change Password
mysql -uroot -p
-
change Password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NoPassword564925080!'; mysql5.7默认安装了密码安全检查插件(validate_password),默认密码检查策略要求密码必须包含:大小写字母、数字和特殊符号,并且长度不能少于8位。否则会提示ERROR 1819 (HY000): Your password does not satisfy the current policy requirements错误.
-
Authorized users remote login
GRANT ALL PRIVILEGES ON *.* TO 'noneplus'@'%' IDENTIFIED BY 'Noneplus564925080!' WITH GRANT OPTION; flush privileges;
-
Open Server 3306 port
-
Remote Connection