1. Go firstOfficial websiteCheck the appropriate version. Here I choose the community version
The RPM bundle is selected here
Enter the Linux usr / local directory to create the MySQL folder
Execute download command
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.23-1.sles12.x86_64.rpm-bundle.tar
Unzip after downloading
tar xf mysql-5.7.23-1.sles12.x86_64.rpm-bundle.tar
Execute in the following order
rpm -ivh mysql-community-common-5.7.23-1.sles12.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.23-1.sles12.x86_64.rpm
rpm -ivh mysql-community-client-5.7.23-1.sles12.x86_64.rpm
rpm -ivh mysql-community-server-5.7.23-1.sles12.x86_64.rpm
To enhance security, MySQL 5 7 randomly generates a password for the root user. If the RPM package is installed, it defaults to / var / log / mysqld Log.
You can use # grep “temporary password” / var / log / mysqld Log command to obtain the temporary password of MySQL
The author here is in / var / log / MySQL / mysqld Found in log
It’s strange that I’ve been making mistakes with this temporary password
Finally, use the administrator password of the currently logged in user to succeed?
what fuck? I don’t know whether it has passed through or changed before (the environment of this virtual machine is complex)
If you still can’t log in, you can refer to the following links
https://www.cnblogs.com/kings…
https://www.jb51.net/article/…
Finally, configure my CNF file restart MySQL
- Uninstall MySQL
Query whether MySQL is installed
rpm -qa | grep mysql
Uninstall related dependencies
rpm -e –nodeps mysql-libs-5.1.73-7.el6.x86_64