ubuntu下mysql连接失败怎么办

ubuntu下mysql连接失败怎么办

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

了解更多ubuntu下mysql连接失败怎么办相关的解答,就上多想派(www.duoxiangpai.com)。

本文章由用户飞秒生活分享,版权归原作者,如侵犯,请联系(点这里联系),经核实,我们将第一时间删除。如若转载,请注明出处:https://www.duoxiangpai.com/64953.html

(0)

相关推荐