解决"ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.247.128' (111)"
来源:互联网 发布:皇室战争迫击炮数据 编辑:程序博客网 时间:2024/06/06 12:40
1. 问题描述
在连接数据库时出现连接失败信息:
xx@ubuntu:~$ mysql -h192.168.247.128 -uroot -p123456mysql: [Warning] Using a password on the command line interface can be insecure.ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.247.128' (111)xx@ubuntu:~$
2. 解决方法
出现上面mysql数据库连接失败的原因是多种的, 其中可用ping ip来看看网络是否畅通,下面是本人的解决方法。
这是因为之前我进行了root密码设置操作,
root@ubuntu:/usr/local/mysql/bin# ./mysqld_safe --user=mysql --skip-grant-tables --skip-networking& [1] 5810
注意上面的--skip-grant-tables --skip-networking,只允许本地socket连接, 放弃对TCP/IP的监听
在解决上述问题之前,我们先保证已经对mysql数据库进行远程授权,
进入/usr/local/mysql/support-files/下, 执行以下命令:
# cp my-default.cnf my.cnf
这里得到了mysql数据库的配置文件my.cnf, 再重启mysql服务, 然后 执行 mysql -h192.168.247.128 -uroot -p (ps:主机ip请输入自己的)
并输入数据库用户root的密码即可连接mysql数据库。如下:
xx@ubuntu:/usr/local/mysql$ sudo ./support-files/mysql.server restart[sudo] password for xx: Shutting down MySQL.... * Starting MySQL.. * xx@ubuntu:/usr/local/mysql$ mysql -h192.168.245.128 -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.7.5-m15 MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>
OK, Enjoy it!!!
0 0
- 解决"ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.247.128' (111)"
- centos6下解决"ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.2.200' (113)"
- 解决ERROR 2003 (HY000): Can't connect to MySQL server on "host" (111)
- 解决ERROR 2003 (HY000): Can't connect to MySQL server on "host" (111)
- ERROR 2003 (HY000): Can't connect to MySQL server on
- ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.114' (111)
- ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.10.210' (111) 解决方法
- ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.157' (111)
- mysql 解决 ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
- MySQL错误ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)的解决
- 【解决】ERROR 2003 (HY000): Can't connect to MySQL server on "host" (113)
- 解决 error 2003 (hy000): can't connect to mysql server on 'localhost' (10061)
- ERROR 2003 (HY000): Can’t connect to MySQL server on ’192.168.119.105′ (10061)
- ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.123' (10061)
- ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.56.105' (113)
- ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.165' (113)
- ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.1.165' (113)
- ERROR 2003 (HY000): Can't connect to MySQL server on "host" (111)
- Ubuntu14.04下安装codeblocks+wxWidgets
- UIScrollView
- oc中类的具体实现方法
- W3C标准-学习笔记
- ViewPager设置高度为warp_content
- 解决"ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.247.128' (111)"
- 《设计模式之禅》——装饰模式
- UML 工具
- hbase 学习资料
- 斐波那契数列分析
- 从零开始做游戏 - 团队简介
- 解决UITableView分割线距左边有距离的办法xcode6
- python相对导入/绝对导入以及__init__.py中的__all__和__path__变量以及sys.path搜索路径
- 属性设置