1 Check if Mysql has been installed
rpm -qa | grep mysql
If you find something, you can use the following command to delete it
rpm -e 文件名
2 Download the official Mysql package
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
3 Install the MySQL package
yum -y install mysql57-community-release-el7-10.noarch.rpm
4 Install MySQL
yum -y install mysql-community-server
5 Start the Mysql service
systemctl start mysqld.service
6 Check the running status of Mysql
service mysqld status
7 View the initial password (the red part is the initial password)
grep ‘password’ /var/log/mysqld.log
8 Enter the database
mysql -u root -p
reset password (for root)
update user set authentication_string=password(‘root’) where user=‘root’;