无法创建 InnoDB 表(错误-1)
我正在将一个相当简单的表移植到我的实时数据库服务器上,当我尝试创建 InnoDB 表时,它给了我这个奇怪的错误,表创建是:
CREATE TABLE `cobertura` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`cep` int(8) unsigned zerofill NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `idx_cep` (`cep`)
) ENGINE=InnoDB;
如果我将引擎更改为 MyISAM 它可以工作,如果我将表名更改为其他东西,它有效。 如果我将表创建为 MyISAM 并将引擎更改为 InnoDB,则会收到错误 121。 我尝试查看 mysql 存储文件的文件夹,看看那里是否有任何垃圾,什么也没有。
有什么想法吗?
I'm porting a rather simple table to my live db server and it's giving me this strange error when I try to create a InnoDB table, table create is:
CREATE TABLE `cobertura` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`cep` int(8) unsigned zerofill NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`),
KEY `idx_cep` (`cep`)
) ENGINE=InnoDB;
If i change the engine to MyISAM it works, if I change the table name to something else, it works.
If i create the table as MyISAM and do an engine alter to InnoDB I get error 121.
I tried looking on the folder where mysql stores the files to see if there's any trash there, nothing.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然数据库名称中可能有破折号(-),但它会阻止 MariaDB(以及 MySQL)将引擎设置为 InnoDB...尽管这充其量只是一个半答案,因为我我正在尝试将整个数据库导入回系统,首先创建的其他表没有问题。不幸的是,这个问题现在强加在我身上,我没有时间开始一个全新的数据库名称方案策略。目前,我正在更改该特定数据库的引擎以使用 MyISAM。
从一般故障排除尝试:
...如果显然未安装 InnoDB,则尝试以下操作:
While the database may have a dash (-) in the name it will prevent MariaDB (and therefore MySQL) from setting the engine to InnoDB...though this is at best a half-answer as while I am trying to import an entire database back in to the system there are other tables that get created first without problems. Unfortunately this issue is now forcing itself upon me and I do not have the time to start a whole new database name scheme policy. For now I'm changing the engine for that particular database to use MyISAM instead.
From general troubleshooting try:
...and if InnoDB isn't installed apparently then try this: