I have a problem in mysql, i try to run this sentence
我在mysql中有问题,我尝试运行这句话
CREATE TABLE IF NOT EXISTS comunidad_estado (
id_comunidad_estado int(11) NOT NULL,
nombre varchar(50) NOT NULL,
id_pais int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=latin1;
and the return is this:
而且回报是这样的:
I know my db is empty but i can´t understand why does not it create the table
我知道我的数据库是空的,但我不明白它为什么不创建表
Thanks in advance.
提前致谢。
2 个解决方案
#1
It seems, schema / database is corrupted / locked.
看来,架构/数据库已损坏/锁定。
Possible solutions:
- Restart mysql service and try again (Sometime lock applies to schema, and somehow doesn't unlock)
- Drop this schema, create new schema and try again (Sometime, on creation of schema - it get corrupted)
- Repair mysql (
mysqlcheck --repair
) - to fix corrupted schemas. - Last, check permission.
重新启动mysql服务并重试(Sometime lock适用于架构,并以某种方式解锁)
删除此架构,创建新架构并重试(有时,在创建架构时 - 它会被破坏)
修复mysql(mysqlcheck --repair) - 修复损坏的模式。
最后,检查权限。
To confirm your script, try @ http://sqlfiddle.com/ . If it works, then above possible reasons with your schema / database.
要确认您的脚本,请尝试@ http://sqlfiddle.com/。如果它有效,那么您的架构/数据库可能会出现上述原因。
#2
If anyone has the same mistake I solved it by changed the name of the query and then rename de db, a really weird work but It´s working. Thanks to Anil for the reference: Table doesn't exist after CREATE TABLE
如果有人有同样的错误我通过更改查询的名称解决它,然后重命名de db,这是一个非常奇怪的工作,但它正在工作。感谢Anil的参考:在CREATE TABLE之后表不存在
#1
It seems, schema / database is corrupted / locked.
看来,架构/数据库已损坏/锁定。
Possible solutions:
- Restart mysql service and try again (Sometime lock applies to schema, and somehow doesn't unlock)
- Drop this schema, create new schema and try again (Sometime, on creation of schema - it get corrupted)
- Repair mysql (
mysqlcheck --repair
) - to fix corrupted schemas. - Last, check permission.
重新启动mysql服务并重试(Sometime lock适用于架构,并以某种方式解锁)
删除此架构,创建新架构并重试(有时,在创建架构时 - 它会被破坏)
修复mysql(mysqlcheck --repair) - 修复损坏的模式。
最后,检查权限。
To confirm your script, try @ http://sqlfiddle.com/ . If it works, then above possible reasons with your schema / database.
要确认您的脚本,请尝试@ http://sqlfiddle.com/。如果它有效,那么您的架构/数据库可能会出现上述原因。
#2
If anyone has the same mistake I solved it by changed the name of the query and then rename de db, a really weird work but It´s working. Thanks to Anil for the reference: Table doesn't exist after CREATE TABLE
如果有人有同样的错误我通过更改查询的名称解决它,然后重命名de db,这是一个非常奇怪的工作,但它正在工作。感谢Anil的参考:在CREATE TABLE之后表不存在