1,直接使用yum快速搭建
使用一下命令
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
完成以后启动mysql服务
启动
systemctl start mysqld.service
停止
systemctl stop mysqld.service
通过如下命令可以在日志文件中找出密码:
grep "password" /var/log/mysqld.log(网上教程说的,我没登录上)
2,登录mysql 创建用户,允许远程登录
我使用上面说的密码还不能登录,只有先设置免密登录设置账户了