不多BB,上操作
1、拉取mysql安装包
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
2、安装mysql源
yum localinstall mysql57-community-release-el7-8.noarch.rpm
中间一次确认的操作,输入y就ok了
3、检查mysql源是否安装成功
yum repolist enabled | grep "mysql.*-community.*"
4、安装mysql
yum install mysql-community-server
看到Complete 说明安装成功
5、启动mysql
systemctl start mysqld
systemctl enable mysqld 设置开机启动
6、查看root用户密码
grep 'temporary password' /var/log/mysqld.log
我的mysql密码是ZyJ33_IinJ4n
设置新的密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
登录成功,目前还不能远程访问,
7、开启远程访问
grant all privileges on *.* to root@'%' identified by Sj1234..''
这样就可以远程访问了