长话短说:

step1:下载mysql源安装包:wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

阿里云安装MySQL5.7

 

step2:安装MySQL源:yum localinstall mysql57-community-release-el7-8.noarch.rpm

阿里云安装MySQL5.7

 

step3:检测是否安装完成:yum repolist enabled | grep "mysql.*-community.*"

阿里云安装MySQL5.7

 

step4:安装mysql:yum install mysql-community-server

阿里云安装MySQL5.7

 


step5:设置开启启动mysql服务:systemctl enable mysqld

阿里云安装MySQL5.7

 


step6:启动MySQL服务:systemctl restart mysqld

阿里云安装MySQL5.7

 

step7:查看MySQL初始密码:grep 'A temporary password' /var/log/mysqld.log

阿里云安装MySQL5.7

 

step8:更改MySQL密码:mysqladmin -u root -p'step7中的就密码' password '您的新密码'

阿里云安装MySQL5.7

 

step9:设置mysql能够远程访问:
登录进MySQL:mysql -uroot -p密码
增加一个用户给予访问权限:grant all privileges on *.* to '用户名'@'ip地址' identified by '密码' with grant option; //可将ip改为%%,表示开启所有的

阿里云安装MySQL5.7

 

注意这里需要再阿里云安全组中开放3306端口供公网访问。详情可参考本人博客:https://www.cnblogs.com/funnyboy0128/p/7966531.html

 

完成以上步骤,在公网通过工具连接测试即可。

 

相关文章:

  • 2021-11-14
  • 2021-11-28
  • 2021-11-05
  • 2021-12-10
  • 2021-11-27
  • 2021-10-13
  • 2021-12-08
  • 2021-12-10
猜你喜欢
  • 2021-04-20
  • 2022-12-23
  • 2021-11-16
  • 2021-09-19
  • 2021-12-02
  • 2021-06-28
  • 2021-12-04
相关资源
相似解决方案