Mysql 远程连接
来源:互联网 发布:网络男歌手名字大全 编辑:程序博客网 时间:2024/06/06 12:44
Connection to mysql server on 10065 解决办法
远程访问linux上 的mysql一直不行,一直报 error 2003 : connection to mysql server on 10065 我是用的 Navicat for MySQL 登陆的
yum install mysql
yum install mysql-server
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 用户登陆 ,在局域网 中 所有的其他主机上都可以访问
最后实在不行 关闭防火墙。
- Mysql远程开启远程连接
- 远程连接mysql资料
- mysql的远程连接
- sqlserver2005远程连接 mysql
- 远程连接MYSQL
- mysql远程连接
- sqlserver2005远程连接 mysql
- 设置mysql远程连接
- 远程连接mysql
- MySQL 远程连接
- ubuntu mysql远程连接
- mysql 远程连接
- MYSQL 远程连接问题
- 远程连接mysql数据库
- mysql 允许远程连接
- 远程连接MySql
- php远程连接mysql
- 远程连接MySQL数据库
- C++数据结构--用向量数组实现大(小)根堆的插入和删除
- 常用排序算法--归并排序
- SAP移动类型路径
- intent intent-filter
- 【rmzt:进击的巨人三笠xp主题】
- Mysql 远程连接
- ZStack串口操作
- 常用排序算法--快速排序
- java集合类详解
- HDOJ 1017 A Mathematical Curiosity
- 堆排序算法 C++
- Oracle死锁的模拟和处理
- STRUTS2最近量产漏洞分析
- J2EE核心:iBatis DAO入门与进阶一