mysql Host 'microsof-80f25e' is not allowed to connect to this MySQL server
2013-08-20 18:35
411 查看
机器重新安装系统后,之前好好的项目运行项目报错:Host '主机名' is not allowed to connect to this MySQL server
控制台信息如下:
[2013-08-20 16:13:00 750][WARN](org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:77)) SQL Error: 0, SQLState: null
[2013-08-20 16:13:00 750][ERROR](org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:78)) Cannot create PoolableConnectionFactory (null, message from server: "Host 'microsof-80f25e' is not allowed to connect to this MySQL server")
[2013-08-20 16:13:00 750][WARN](org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:109)) Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (null, message from server: "Host 'microsof-80f25e' is not allowed to connect to this MySQL server")
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
…………………………
系统中我用的是root账号,也就是root用户没有远程访问主机的缘故(当初安装Mysql时,没有勾选Enable root access from remote machines)
如下图所示:
解决方法1:打开mysql的实例配置向导:MySQL Server Instance Config Wizard,勾选Enable root access from remote machines即可。
解决方法2:修改root权限,让root用户拥有远程访问的权限:
(2)
PS:第二种方式没有效果的话,重启动下机器。
控制台信息如下:
[2013-08-20 16:13:00 750][WARN](org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:77)) SQL Error: 0, SQLState: null
[2013-08-20 16:13:00 750][ERROR](org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.java:78)) Cannot create PoolableConnectionFactory (null, message from server: "Host 'microsof-80f25e' is not allowed to connect to this MySQL server")
[2013-08-20 16:13:00 750][WARN](org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:109)) Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (null, message from server: "Host 'microsof-80f25e' is not allowed to connect to this MySQL server")
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
…………………………
系统中我用的是root账号,也就是root用户没有远程访问主机的缘故(当初安装Mysql时,没有勾选Enable root access from remote machines)
如下图所示:
解决方法1:打开mysql的实例配置向导:MySQL Server Instance Config Wizard,勾选Enable root access from remote machines即可。
解决方法2:修改root权限,让root用户拥有远程访问的权限:
//赋予root访问任何主机数据的权限
(1)GRANT
ALL
PRIVILEGES
ON
*.*
TO
'root'
@
'%'
WITH
GRANT
OPTION
//使修改配置生效
(2)
FLUSH
PRIVILEGES
PS:第二种方式没有效果的话,重启动下机器。
相关文章推荐
- Host 'XXX' is not allowed to connect to this MySQL server 解决方案/如何开启MySQL的远程帐号
- ERROR 1130: Host 'A'is not allowed to connect to this MySQL server
- ERROR 1130: Host 'A'is not allowed to connect to this MySQL server
- ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server
- mysql不支持远程连接的解决办法(#1130 - Host 'localhost' is not allowed to connect to this MySQL server)
- ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL server
- MySQL Error 1130 Host 'localhost' is not allowed to connect to this MySQL server
- jdbc连接mysql时报message from server: "Host '**' is not allowed to connect to this MySQL server"错误解决
- Error No. 1130 Host '*.*.*.*' is not allowed to connect to this MySQL server解决方法
- Host 'XXX' is not allowed to connect to this MySQL server 解决方案/如何开启MySQL的远程帐号
- ERROR 1130 (HY000): Host 'xxxxxx' is not allowed to connect to this MySQL server解决办法
- MySQL: Host '127.0.0.1' is not allowed to connect to this MySQL server
- Host '192.168.2.189' is not allowed to connect to this MySQL server
- MySQL Error 1130 Host 'localhost' is not allowed to connect to this MySQL server
- Host '2003SERVER' is not allowed to connect to this MySQL server
- mysql不支持远程连接的解决办法(#1130 - Host 'localhost' is not allowed to connect to this MySQL server)
- mysql: 1130 Host '192.168.1.3' is not allowed to connect to this MySQL server
- SQL Error (1130): Host '192.168.1.100' is not allowed to connect to this MySQL server
- mysql本地訪问linuxserver,出现SQLSTATE[HY000] [1130] Host '127.0.0.1' is not allowed to connect to this
- ERROR 1130: Host 'A'is not allowed to connect to this MySQL server