linux 服务器mysql已经配置好,远程连接不上(已解决)
2009-01-09 16:21
1016 查看
先确认你已经开始了允许远程访问的权限:
◆为了在其它电脑上能用root用户登录,需进行以下动作:
1、mark@marklinux mark>mysql -h localhost -u root
//这样应该可以进入MySQL服务器
2、mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION
//赋予任何主机访问数据的权限
3、mysql>FLUSH PRIVILEGES
//修改生效
4、mysql>EXIT
//退出MySQL服务器
这样就可以在其它任何的主机上以root身份登录啦!
客户端(windows)
c:/program files/mysql/mysql server 5.1/bin>mysql -h 192.168.0.249 -uroot -p
enter password:
远程报错:
ERROR 2003(HY000):Can't connect to MySQL server on '192.168.0.249' (10065)
把linux服务器的防火墙添加端口tcp: 3306后就OK了。
c:/program files/mysql/mysql server 5.1/bin>mysql -h 192.168.0.249 -uroot -p
enter password:
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 13
Server version:4.1.22-standard-log
Type 'help' or '/h' for help. Type '/c' to clear the buffer.
mysql>
如果出现: 1045 Access denied for user 'root'@'192.168.1.3' (using password:YES) 错误的话。
是因为上述第二步密码为'%' 所以不用加密码即可。
◆为了在其它电脑上能用root用户登录,需进行以下动作:
1、mark@marklinux mark>mysql -h localhost -u root
//这样应该可以进入MySQL服务器
2、mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION
//赋予任何主机访问数据的权限
3、mysql>FLUSH PRIVILEGES
//修改生效
4、mysql>EXIT
//退出MySQL服务器
这样就可以在其它任何的主机上以root身份登录啦!
客户端(windows)
c:/program files/mysql/mysql server 5.1/bin>mysql -h 192.168.0.249 -uroot -p
enter password:
远程报错:
ERROR 2003(HY000):Can't connect to MySQL server on '192.168.0.249' (10065)
把linux服务器的防火墙添加端口tcp: 3306后就OK了。
c:/program files/mysql/mysql server 5.1/bin>mysql -h 192.168.0.249 -uroot -p
enter password:
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 13
Server version:4.1.22-standard-log
Type 'help' or '/h' for help. Type '/c' to clear the buffer.
mysql>
如果出现: 1045 Access denied for user 'root'@'192.168.1.3' (using password:YES) 错误的话。
是因为上述第二步密码为'%' 所以不用加密码即可。
相关文章推荐
- mysql 5.7.20, for Linux (x86_64) 配置远程连接 10061问题解决方案
- 远程连接阿里云 Linux 服务器上 MySQL 服务失败的解决办法
- SSM项目连接远程Linux服务器的mysql 启动tomcat卡在了 Initializing Spring root WebApplicationContext
- [Linux] 解决远程连接Mysql太慢问题
- 无法远程连接MySql服务器解决方法(错误号:1130)
- linux远程服务器启动mysql时显示:/tmp/mysql.sock 不存在的解决方法
- 关于linux安装mysql没有初始化密码、忘记密码、无法远程连接的解决方法
- 设置linux上mysql连接远程服务器
- 阿里云服务器 mysql远程连接时,出现连接不上的解决办法
- Ubuntu16.04服务器安装配置MySQL并开启远程连接
- linux配置mysql数据库远程连接失败的解决方法
- linux配置了dns后导致mysql远程连接慢问题
- 阿里云服务器配置MySQL远程连接
- 在Linux环境下mysql的root密码忘记解决方法 1.首先确认服务器出于安全的状态,也就是没有人能够任意地连接MySQL数据库。 2.修改MySQL的登录设置: # vi /etc/my.c
- linux下mysql不能被远程连接的解决方法
- [转]解决阿里云mysql不能连接,配置mysql远程连接
- 阿里云 ECS服务器配置Win,域名解析无效,FTP无法连接,远程桌面无法连接问题解决
- MySQL环境搭建以及服务器远程连接的配置(WindowsX64)
- python3数据库配置,远程连接mysql服务器
- 远程连接Ubuntu服务器的mysql出现没有权限错误的解决办法