is not allowed to connect to this MySQL server
来源:互联网 发布:手机淘宝积分在那里看 编辑:程序博客网 时间:2024/06/18 14:17
当你在java web中使用JDBC连接到MySql时,默认是准许用户通过localhost访问的,但是换成你主机的ip地址进行访问时,就不行了,这里提供一个修改数据库访问权限的方法:
首先进入mysql安装的bin目录,运行cmd,例如我的目录是D:\mySql\bin
1. 通过账号密码登录mysql;
2. 输入:D:\mySql\bin>mysql -u 用户名 -p密码。
3. 根据以下“修改数据库权限”内容进行相关输入。
修改数据库权限
1、设置通过用户名(例如:roems)使用密码(例如:password)从任何主机连接到MySql服务器:
mySql>GRANT ALL PRIVILEGES ON *.* TO 'roems'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;mySql>FLUSH PRIVILEGES;
2、设置通过用户名(例如:roems)使用密码(例如:password)从ip为192.168.1.100的主机连接到MySql服务器:
mySql>GRANT ALL PRIVILEGES ON *.* TO 'roems'@'192.168.1.100' IDENTIFIED BY 'password' WITH GRANT OPTION;mySql>FLUSH PRIVILEGES;
3、设置通过用户名(例如:roems)使用密码(例如:password)从ip为192.168.1.100的主机连接到MySql服务器的 info 数据库:
mySql>GRANT ALL PRIVILEGES ON dk.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;mySql>FLUSH PRIVILEGES;
这样就OK啦。
阅读全文
0 0
- 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
- 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
- 效果图第二课笔记:几何体建模
- vue.js2.0完整视频教程12套
- ART GC ModUnionTable 实现及使用
- 每天回顾linux命令(pushd、pwd、popd)
- 参考博客
- is not allowed to connect to this MySQL server
- DirectX11笔记(一)--配置DirectX工程
- 迭代器模式
- BZOJ 1922 [Sdoi2010]大陆争霸
- 数据库连接池c3p0和dbcp
- C语言中字符串处理小案例(查找)
- Java设计模式--代理模式proxy
- 嵌入式开发——ubuntu下NFS安装与配置
- 机器学习笔记(2)-决策树