To be ashamed, MySQL has been in a phase that will only be used and not understood. Even some of the more profound management, are not familiar with, have to strengthen AH!
Recently, system testing, using MySQL database, need to create a trigger on a table, the database is installed natively. However, you cannot create a trigger at any rate, and the background error message is as follows:
Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:TRIGGER command denied to user ' root ' @ ' mortimer-pc ' for Table ' T_user ' at Sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) at Sun.reflect.NativeConstructorAccessorImpl.newInstance (nativeconstructoraccessorimpl.java:39) at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance (delegatingconstructoraccessorimpl.java:27) at Java.lang.reflect.Constructor.newInstance (constructor.java:513) 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:4096) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:4028) at Com.mysql.jdbc.MysqlIO.sendCommand (Mysqlio.java : 2490) at Com.mysql.jdbc.MysqlIO.sqlQueryDirect (mysqlio.java:2651) at Com.mysql.jdbc.ConnectionImpl.execSQL ( connectionimpl.java:2677) at Com.mysql.jdbc.ConnectionImpl.execSQL (connectionimpl.java:26At Com.mysql.jdbc.StatementImpl.execute (statementimpl.java:841) at Com.mysql.jdbc.StatementImpl.execute ( statementimpl.java:681) at Com.apusic.jdbc.adapter.StatementHandle.execute (Unknown Source) at Com.apusic.esb.base.util.SQLUtil.createDBObjectIfNecessary (sqlutil.java:263) at Com.apusic.esb.base.util.SQLUtil.createDBObjectIfNecessary (sqlutil.java:225) at Com.apusic.esb.config.trigger.mysql.MySqlTriggerManager.createTriggersIfNecessary (mysqltriggermanager.java:83) At Com.apusic.esb.config.trigger.TriggerConfigManager.deploy (triggerconfigmanager.java:331) at SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at Sun.reflect.NativeMethodAccessorImpl.invoke ( nativemethodaccessorimpl.java:39) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( DELEGATINGMETHODACCESSORIMPL.JAVA:25) at Java.lang.reflect.Method.invoke (method.java:597) at Com.apusic.esb.base.communication.CommInvokeUtil.invoke (comminvokeutil.java:139) at Com.apusic.esb.base.communication.CommInvokeUtil.invoke (Comminvokeutil.java:At Com.apusic.esb.base.communication.CommInvokeUtil.invoke (comminvokeutil.java:27) at Com.apusic.esb.base.communication.socket.server.commsocketserver$requestprocessor.run (CommSocketServer.java:99 ) at Com.apusic.util.threadpoolimpl$workerthread.run (Unknown Source) 2014-06-25 10:38:42 Error [ Apusic.com.apusic.esb.config.trigger.TriggerConfigManager] Com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:TRIGGER command denied to user ' root ' @ ' mortimer-pc ' for Table ' T_user ' at Sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native Method) at Sun.reflect.NativeConstructorAccessorImpl.newInstance (nativeconstructoraccessorimpl.java:39) at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance (delegatingconstructoraccessorimpl.java:27) at Java.lang.reflect.Constructor.newInstance (constructor.java:513) 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:4096) at Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:4028) at Com.mysql.jdbc.MysqlIO.sendCommand (mysqlio.java:2490) at Com.mysql.jdbc.MysqlIO.sqlQueryDirect (mysqlio.java:2651 ) at Com.mysql.jdbc.ConnectionImpl.execSQL (connectionimpl.java:2677) at Com.mysql.jdbc.ConnectionImpl.execSQL ( connectionimpl.java:2627) at Com.mysql.jdbc.StatementImpl.execute (statementimpl.java:841) at Com.mysql.jdbc.StatementImpl.execute (statementimpl.java:681) at Com.apusic.jdbc.adapter.StatementHandle.execute ( Unknown Source) at Com.apusic.esb.base.util.SQLUtil.createDBObjectIfNecessary (sqlutil.java:263) at Com.apusic.esb.base.util.SQLUtil.createDBObjectIfNecessary (sqlutil.java:225) at Com.apusic.esb.config.trigger.mysql.MySqlTriggerManager.createTriggersIfNecessary (mysqltriggermanager.java:83) At Com.apusic.esb.config.trigger.TriggerConfigManager.deploy (triggerconfigmanager.java:331) at SUN.REFLECT.NATIVEMETHODACCESSORIMPL.INVOKE0 (Native Method) at sun.reflect.NativeMethodAccessOrimpl.invoke (nativemethodaccessorimpl.java:39) at Sun.reflect.DelegatingMethodAccessorImpl.invoke ( DELEGATINGMETHODACCESSORIMPL.JAVA:25) at Java.lang.reflect.Method.invoke (method.java:597) at Com.apusic.esb.base.communication.CommInvokeUtil.invoke (comminvokeutil.java:139) at Com.apusic.esb.base.communication.CommInvokeUtil.invoke (comminvokeutil.java:43) at Com.apusic.esb.base.communication.CommInvokeUtil.invoke (comminvokeutil.java:27) at Com.apusic.esb.base.communication.socket.server.commsocketserver$requestprocessor.run (CommSocketServer.java:99 ) at Com.apusic.util.threadpoolimpl$workerthread.run (Unknown Source)
Parse error message: TRIGGER command denied to user ' root ' @ ' mortimer-pc ' for table ' T_user ', it appears that the root user is not allowed to execute the t_user command on the TRIGGER table, why not?
Analysis, the first question is whether to drive the problem, because, the driver does have a mismatch problem, the driver version is lower (for 5.0), and the server version is 5.5, the problem remains after the replacement drive.
Secondly, the analysis of the error message itself, does not allow the execution of God Horse command, seems to be a permission problem, Navicat connection database, view user rights, found that the user "[email protected]%" "Trigger" column is not selected! The user of this connection appears to be "[email protected]", so the "[email protected]" rule does not seem to take effect, which is estimated to be the cause of the failure to create the trigger.
Adjust the "[email protected]%" User's permissions, select the "Trigger" column, restart the MySQL service, reconnect MySQL, create a trigger, ok!