1.更新yum源:
rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
2.安装mysql:
yum -y install mysql-community-server --nogpgcheck
3.查看是否安装成功;
mysql -V
4.启动mysql:
systemctl start mysqld
5.设置开机自启:
systemctl enable mysqld
6.查看初始密码:ufu/y+lpX91p
grep 'temporary password' /var/log/mysqld.log
7.mysql安全设置:
mysql_secure_installation 一步一步操作下去。
8.下面是登录msyql:
mysql -uroot -p
然后输入密码:asd123Q! 登录进去