如何在MySQL中禁用--skip-grant-tables?

Jad*_*ade 0 mysql sql jdbc

我正在尝试为我的OpenGTS安装初始化数据库。但是,当我运行完成此操作的shell脚本时,出现以下错误:

Version: 2.4.5
Database created: gts
[ERROR|DBAdmin.execCommands:843] ==> SQLException: DB grant error [jdbc:mysql://localhost:3306/]
[ERROR|DBAdmin.execCommands:843] Message:   The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
[ERROR|DBAdmin.execCommands:843] SQLState:  HY000
[ERROR|DBAdmin.execCommands:843] ErrorCode: 1290
[DBAdmin.execCommands:843] java.sql.SQLException: The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
java.sql.SQLException: The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2642)
        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1647)
        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1566)
        at org.opengts.dbtools.DBConnection._executeUpdate(DBConnection.java:961)
        at org.opengts.dbtools.DBConnection.executeUpdate(DBConnection.java:908)
        at org.opengts.dbtools.DBConnection.executeUpdate(DBConnection.java:889)
        at org.opengts.dbtools.DBProvider.grantDBUser(DBProvider.java:2132)
        at org.opengts.dbtools.DBAdmin.execCommands(DBAdmin.java:841)
        at org.opengts.db.DBConfig._main(DBConfig.java:1246)
        at org.opengts.db.DBConfig.main(DBConfig.java:1361)
Run Code Online (Sandbox Code Playgroud)

我认为很明显我需要禁用--skip-grant-tables,但是一般来说,我是MySQL和SQL的新手。最近,我遵循了一个教程来重置MySQL根密码,并且我相信通过它启用了--skip-grant-tables。我试图寻找解决方案以禁用此功能,但没有遇到任何问题。

有人能帮忙吗?

小智 5

只需键入:mysqladmin shutdown,然后通过运行命令:启动MySQL服务service mysql start

:-)