检查是否安装,如果安装则卸载
rpm -qa|grep mysql
rpm -e --nodeps
下载rpm包仓库
wget https://repo.mysql.com/mysql80-community-release-el8-1.noarch.rpm
rpm -ivh mysql80-community-release-el8-1.noarch.rpm
yum update
yum install mysql-server
systemctl start mysqld
systemctl enable mysqld
systemctl status mysqld
systemctl enable mysqld.service
mysql
use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'tw369.com';
FLUSH PRIVILEGES;
mysql -uroot -p
设置Mysql远程访问账户密码
update user set host ="%" where user = "root";
flush privileges;