使用 MySQL 5.5.31
请参阅下面的 SQL:
set @auto_table = 'MyTableName';
PREPARE stmt FROM 'ALTER TABLE `?` AUTO_INCREMENT = 1';
EXECUTE stmt USING @auto_table;
来自 MySQL 的错误消息:
Incorrect arguments to EXECUTE
我试图将第二行更改为:
PREPARE stmt FROM 'ALTER TABLE ? AUTO_INCREMENT = 1';
然后错误信息是:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? AUTO_INCREMENT = 1' at line 1