rpm -qa |grep -i mysql
systemctl stop mysqld.service
yum remove mysql-community-common-5.7.20-1.el7.x86_64
find / -name mysql
rm -rf xxxx
rm -rf /etc/my.cnf
rm -rf /var/log/mysqld.log
wget https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm
rpm -ivh mysql80-community-release-el8-1.noarch.rpm
yum install mysql-server --nogpgcheck
systemctl list-unit-files|grep mysqld
systemctl enable mysqld.service
systemctl list-unit-files|grep mysqld
systemctl start mysqld.service
ps -ef|grep mysql
vim /etc/my.cnf
i
skip-grant-tables
systemctl restart mysqld.service
mysql
UPDATE mysql.user SET authentication_string=null WHERE User='root';
FLUSH PRIVILEGES;
quit;
mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'your password';
quit;
vim /etc/my.cnf
删除skip-grant-tables
esc :wq
systemctl restart mysqld.service
mysql -u root -p
update mysql.user set host = '%' where user = 'root' and host='localhost';
systemctl restart mysqld.service