1

I have a problem in mysql, i try to run this sentence

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:

https://imageshack.com/i/pdR670xhp

I know my db is empty but i can´t understand why does not it create the table

https://imageshack.com/i/idnYVanJp

Thanks in advance.

jww
  • 97,681
  • 90
  • 411
  • 885
ivan
  • 33
  • 8
  • I tried this statement on mysql 5.6 and it worked, further you can refer http://stackoverflow.com/questions/8142002/table-doesnt-exist-after-create-table – Anil May 11 '15 at 09:09
  • Are you sure that it doesn't run because it works fine on my side. – Prerak Sola May 11 '15 at 09:09
  • @AnilKumar wow, I searched just before and I didn´t found nothing, but by the way it was the solution, I have just created the table with other name, and then renamed it, it´s working. Thanks – ivan May 11 '15 at 09:14

2 Answers2

1

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

Community
  • 1
  • 1
ivan
  • 33
  • 8
0

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.

To confirm your script, try @ http://sqlfiddle.com/ . If it works, then above possible reasons with your schema / database.

Love Sharma
  • 1,981
  • 1
  • 18
  • 37