Step1 确认系统中是否安装了mysql
mysql -V
Step 2 下载mysql的repo源
1)去mysql官网:https://dev.mysql.com/downloads/repo/yum/,找到对应mysql版本:
2)得到repo源地址后使用wget进行下载:
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum localinstall mysql80-community-release-el7-3.noarch.rpm
yum install -y mariadb-server
systemctl start mysqld
查看密码
cat /var/log/mysqld.log | grep password
mysql -uroot -p
alter user 'root'@'localhost' identified by 'Root@8888';
use mysql
允许远程链接
update user set host='%' where user='root';
flush privileges;