Host '***' is not allowed to connect to this MySQL server

                                              Host '****' is not allowed to connect to this MySQL server




           今天运行项目报错“Host '***' is not allowed to connect to this MySQL server”;将mysql的数据库链接改成了一个远程服务器上的;

            
Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: null,  message from server: "Host 'Static' is not allowed to connect to this MySQL server"
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
	at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:280)
	... 51 more
Caused by: java.sql.SQLException: null,  message from server: "Host 'Static' is not allowed to connect to this MySQL server"
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:997)
	at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)
	at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
	at java.sql.DriverManager.getConnection(DriverManager.java:582)
	at java.sql.DriverManager.getConnection(DriverManager.java:154)
	at org.logicalcobwebs.proxool.DefaultConnectionBuilder.buildConnection(DefaultConnectionBuilder.java:39)
	at org.logicalcobwebs.proxool.Prototyper.buildConnection(Prototyper.java:159)
	at org.logicalcobwebs.proxool.ConnectionPool.getConnection(ConnectionPool.java:211)
	at org.logicalcobwebs.proxool.ProxoolDataSourceEx.getConnection(ProxoolDataSourceEx.java:89)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
	... 52 more

修改这个错误如下:

               1: 在这台远程服务器上用“Navicat Premium”工具登录上数据库;

               2:点击“用户”-修改主机这一项; 将“locahost”改成“%”
                      

                   

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值