MySQL一直处于只会用,不怎么理解的阶段。甚至是一些较为深层次的管理,都不怎么熟悉,得加强啊!近日,系统测试,使用MySQL数据
说来惭愧,MySQL一直处于只会用,不怎么理解的阶段。甚至是一些较为深层次的管理,都不怎么熟悉,得加强啊!
近日,,系统测试,使用MySQL数据库,需要在某个表上创建触发器,数据库是在本机安装。但是,无论如何都无法创建触发器,后台错误信息如下:
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)
2014-06-25 10:38:42 错误 [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)
分析错误信息:TRIGGER command denied to user 'root'@'mortimer-PC' for table 't_user',看起来是不允许root用户在t_user表上执行TRIGGER命令,为啥不允许?
分析下,首先怀疑是否驱动的问题,因为,驱动确实存在不匹配的问题,驱动的版本较低(针对5.0),而服务器版本为5.5,替换驱动之后问题依旧。

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 English version
Recommended: Win version, supports code prompts!
