Stand-alone installation
First step: Check if MySQL is installed.
Rpm-qa|grep MySQL
Step two: Uninstall MySQL
Yum remove MySQL mysql-server mysql-libs mysql-common
Rm-rf/var/lib/mysql
Rm/etc/my.cnf
Step three: Install MySQL.
Download the official Yum respository for MySQL
Wget-i-C http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
Install Yum Respository
Yum-y Install mysql57-community-release-el7-10.noarch.rpm
Yum install MySQL
Yum-y Install Mysql-community-server
Fourth step: MySQL settings
Start MySQL First
Systemctl Start Mysqld.service
View MySQL Status
Systemctl Status Mysqld.service
Locate the password in the log file:
grep "Password"/var/log/mysqld.log
Enter the database:
Mysql-uroot-p # Enter the password after entering the carriage
Change Password
ALTER USER ' root ' @ ' localhost ' identified by ' root ';
MySQL complete initial password rules can be viewed by the following commands:
mysql> SHOW VARIABLES like ' validate_password% ';
Modify password Rules
Set global validate_password_policy=0;
Set global validate_password_length=1;
ALTER USER ' root ' @ ' localhost ' identified by ' root ';
Uninstalling Yum Respository
Yum-y Remove Mysql57-community-release-el7-10.noarch
MySQL stand-alone installation