Connection to mysql server on 10065 解决办法
2012-10-28 12:48
232 查看
Connection to mysql server on 10065 解决办法
远程访问linux上 的mysql一直不行,一直报 error 2003 : connection to mysql server on 10065 我是用的 Navicat for MySQL 登陆的1.
修改方式1代码
改表法。
可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -p123
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
改表法。
可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -p123
mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
2. 进入mysql 授予表 数据库 权限
修改二代码
授权法。例如,你想 Ufinity
使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TOIDENTIFIED BY 'mypassword' WITH GRANT OPTION;
要及时生效 : FLUSH PRIVILEGES
如果你想允许用户kevin从ip为192.168.1.139的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TOIDENTIFIED BY 'mypassword' WITH GRANT OPTION;
3. 防火墙
最后方法代码
//关闭防火墙
service iptables stop
小结 :
其实1,2都是为了在mysql 的 mysql数据库中的 user表 里面有这样的记录
Sql代码
select Host ,User from user where User ='root' and Host ='%';
select Host ,User from user where User ='root' and Host ='%'; +------+------+
| Host | User |
+------+------+
| % | root |
+------+------+
意思是 以root 用户登陆 ,在局域网 中 所有的其他主机上都可以访问
最后实在不行 关闭防火墙。
相关文章推荐
- ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061) 解决办法
- MySQL报错 ”Can't connect to MySQL server on localhost (10061)”解决办法
- Lost connection to MySQL server at 'reading authorization packet' 处理解决办法
- 遇见Lost connection to MySQL server at 'reading initial communication packet',system error:0的解决办法
- mysql 出现2003- cant connect to MYSQL server on localhost 的解决办法
- mysql中连接失败2003(Can't connect to server on 'localhost'(10038))错误解决办法
- MySQL Workbench:Error Code: 2013. Lost connection to MySQL server during query解决办法
- mysql服务无法启动,ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)解决办法
- MySQL服务无法启动(2003 - Can't connect to MySQL server on‘localhost' (10061).) 解决办法
- error linux connection to mysql server on 10065
- mysql 出现2003- cant connect to MYSQL server on localhost 的解决办法
- ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 104原因和解决办法
- Navicat连接远程mysql数据库error报错2003 can't connect to mysql server on 10038解决办法
- Can't connect to MySQL server on 'localhost' (10061) 错误解决办法
- "Can't connect to Mysql server on .....(10038)"的解决办法
- Can't connect to MySQL server on 'localhost' (10061)的解决办法!
- Navicat Lite 提示Connection to mysql server on 10065
- 重新安装mysql 出现问题 can't connect to mysql server on 'localhost'的解决办法
- python MySQLdb连接MySQL数据库报错(2003, "Can't connect to MySQL server on 'localhost' (10061)")解决办法
- mysql远程连接:ERROR 1130 (HY000): Host '*.*.*.*' is not allowed to connect to this MySQL server解决办法