MySQL:远程访问权限,is not allowed to connect to this MySQL server
来源:互联网 发布:无间道天台对白 知乎 编辑:程序博客网 时间:2024/06/04 23:18
一、连接数据库错误
1.1 错误现象
mysql_real_connect() error: Host '192.168.175.1' is not allowed to connect to this MySQL server
1.2 原因
客户端IP没有访问远程数据库的权限。
二、解决办法
2.1 修改权限
命令:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.175.1' IDENTIFIED BY 'love' WITH GRANT OPTION;
FLUSH PRIVILEGES;
含义:
让IP为192.168.175.1的用户,可以使用用户名root和密码love来访问数据库。
如果把192.168.175.1换成%,表示所有IP的用户,都可以使用用户名root和密码love来访问数据库。
2.2 修改表
mysql的访问权限保存在数据库mysql的user表中。可以直接修改库mysql的user表来修改权限。
use mysql;
select host,user from user;
参考资料:
MySQL远程连接数据库:is not allowed to connect to this MySQL server:http://www.360doc.com/content/11/1024/15/5907545_158705599.shtml
- MySQL:远程访问权限,is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- Android应用程序访问远程数据库(mysql) is not allowed to connect to this MySQL server
- 远程访问mysql server报错:is not allowed to connect to this mysql
- mysql 远程访问不行解决方法,Host '' is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- mysql 远程访问不行解决方法 Host is not allowed to connect to this MySQL server
- Mysql:is not allowed to connect to this MySQL server
- Mysql:is not allowed to connect to this MySQL server
- Mysql:is not allowed to connect to this MySQL server
- Mysql:is not allowed to connect to this MySQL server
- Mysql:is not allowed to connect to this MySQL server
- Mysql:is not allowed to connect to this MySQL server
- Mysql:is not allowed to connect to this MySQL server
- Mysql:is not allowed to connect to this MySQL server
- Mysql:is not allowed to connect to this MySQL server
- 欢迎邮件联系!
- wireshark 用法
- md5加密
- MVC举例
- 完美删除vector的“内存空洞”
- MySQL:远程访问权限,is not allowed to connect to this MySQL server
- MYSQL查询优化:数据类型与效率
- 唐巧
- 【jQuery应用】5秒后释放button键,position的relative和absolute心得
- How-to: use spark to suport query across mysql tables and hbase tables
- 【慕课笔记】PHP面向对象编程——特殊实践(DAY 4)
- MYSQL查询优化:调度和锁定
- Android四舍五入保留两位小数
- MYSQL查询优化:管理员的优化措施