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


上一篇:mysql主从同步失败怎么办

下一篇:mysql导入sql文件失败怎么办


ubuntu MySQL
Copyright © 2002-2019 测速网 www.inhv.cn 皖ICP备2023010105号
测速城市 测速地区 测速街道 网速测试城市 网速测试地区 网速测试街道
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!

热门搜索 城市网站建设 地区网站制作 街道网页设计 大写数字 热点城市 热点地区 热点街道 热点时间 房贷计算器