欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

阿里云ecs安装mysql数据库途中遇到的坑

程序员文章站 2022-04-30 22:41:38
...

安装命令

wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
rpm -ivh mysql-community-release-el6-5.noarch.rpm
yum install -y mysql-community-server

1、启动失败

执行命令:

systemctl start mysqld

执行结果:

Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.

解决办法:
删除 /var/lib 目录下mysql文件夹

2、SQLyog客户端连接mysql失败

需要修改3处地方:

2.1、关闭linux防火墙

systemctl stop firewalld

2.2、添加ecs安全组安全策略,开放3306端口

安全组规则 -> 添加安全组规则
阿里云ecs安装mysql数据库途中遇到的坑
[参考文档]
https://blog.csdn.net/c12345423/article/details/78671483
https://blog.csdn.net/u013225178/article/details/79403377

2.3、设置root账户访问权限

update user set host='%' where user='root' and host='localhost';
flush privileges;

[参考文档]
https://www.jb51.net/article/121173.htm

3、本地客户端终于可以成功连接上云mysql服务器