关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

云服务器ubuntu系统下mysql连接失败怎么办

发布时间:2021-01-24 11:05:02
1491984010112764.jpg

image.png

ubuntu中连接mysql失败的解决方法

原因:Ubuntu在mysql的配置文件中默认绑定了本机ip,需要修改配置文件并赋予权限。

1.在ubuntu命令行中,打开my.cnf配置文件;

/etc/mysql/my.cnf

2.my.cnf配置文件打开后,在文件进行以下修改:

# Instead of skip-networking the default is now to listen only on# localhost which is more compatible and is not less secure.bind-address = 127.0.0.1

3.my.cnf配置文件修改好后,使用service命令启动MySQL;

service mysql start

4.最后,MySQL启动后,使用root用户即可连接到MySQL;

mysql -u root -p



/template/Home/8a/PC/Static