本人在创建存储过程的时候出现"错误码: 1307 Failed to CREATE PROCEDURE
mysql创建存储过程失败"错误,经查资料实践后整理得出是mysql本身的问题,解决办法:
先将phpmyadmin中的mysql数据库中的表proc删除
然后执行以下代码重建该表,经测试成功.
Java代码
CREATE TABLE `proc` (
`db` char(64) character set utf8 collate utf8_bin NOT NULL default '',
`name` char(64) NOT NULL default '',
`type` enum('FUNCTION','PROCEDURE') NOT NULL,
`specific_name` char(64) NOT NULL default '',
`language` enum('SQL') NOT NULL default 'SQL',
`sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA',
'MODIFIES_SQL_DATA') NOT NULL
default 'CONTAINS_SQL',
`is_deterministic` enum('YES','NO') NOT NULL default 'NO',
`security_type` enum('INVOKER','DEFINER') NOT NULL default 'DEFINER',
`param_list` blob NOT NULL,
`returns` char(64) NOT NULL default '',
`body` longblob NOT NULL,
`definer` char(77) character set utf8 collate utf8_bin NOT NULL default '',
`created` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL default '0000-00-00 00:00:00',
`sql_mode` set
('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE',
'NOT_USED','ONLY_FULL_GROUP_BY'
,'NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL',
'ORACLE','MSSQL','DB2','MAXDB','NO_K
EY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','GBASE80',
'GBASE81','ANSI','NO_AUTO_VALUE_ON_
ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_
ALL_TABLES','NO_ZERO_IN_DATE','NO_ZE
RO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL',
'NO_AUTO_CREATE_USER','HIGH
_NOT_PRECEDENCE') NOT NULL default '',
`comment` char(64) character set utf8 collate utf8_bin NOT NULL default '',
`character_set_client` char(32) character set utf8 collate utf8_bin default NULL,
`collation_connection` char(32) character set utf8 collate utf8_bin default NULL,
`db_collation` char(32) character set utf8 collate utf8_bin default NULL,
`body_utf8` longblob,
PRIMARY KEY (`db`,`name`,`type`)
) DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'
注意:在删除proc表之前最好先把查询窗口弹出,不然你删除proc表中没发通过sql创建改表
--转自