我正在尝试在运行 centOS 6.5 的服务器上安装 opengts。
这是我第一次使用 Java ODBC 驱动程序。
我可以使用 mysql 客户端编辑数据库mysql -u root -p
,但是当我运行数据库初始化脚本 ( initdb.sh ) 时出现错误
[ERROR|DBAdmin.execCommands:962] Message: Access denied for user 'root'@'%' to database 'gts'
[ERROR|DBAdmin.execCommands:962] SQLState: 42000
[ERROR|DBAdmin.execCommands:962] ErrorCode: 1044
[DBAdmin.execCommands:962] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'root'@'%' to database 'gts'
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'root'@'%' to database 'gts'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:534)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1749)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1666)
at org.opengts.dbtools.DBConnection._executeUpdate(DBConnection.java:1006)
at org.opengts.dbtools.DBConnection.executeUpdate(DBConnection.java:950)
at org.opengts.dbtools.DBConnection.executeUpdate(DBConnection.java:931)
at org.opengts.dbtools.DBProvider.grantDBUser(DBProvider.java:2421)
at org.opengts.dbtools.DBAdmin.execCommands(DBAdmin.java:960)
at org.opengts.db.DBConfig._main(DBConfig.java:1548)
at org.opengts.db.DBConfig.main(DBConfig.java:1663)
我已将所有特权授予用户 root 并重新启动 mysqld 但没有运气。如果有人能帮我解决这个问题,我将不胜感激。
谢谢,赛。