Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table doesn't exist after CREATE TABLE

Tags:

I'm trying to import this sql in my database name symfony

CREATE TABLE IF NOT EXISTS ingredient (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1;

and i get

#1146 - Table 'symfony.ingredient' doesn't exist

This seems rather odd since i'm trying here to CREATE this table, so... why is it not working ? I've got the same problem if i try

CREATE TABLE symfony.ingredient

Or the feature in symfony 2

c:\Dev\Symfony>php app/console doctrine:schema:create

PS: I have this problem only with the new version of xampp.

EDIT

Well, i somehow managed to solve my problem. I dropped my database, then created one (not with the interface) and finally i restarded mysql service. I don't know why and how it unstuck me, but i hope this will help someone.

like image 418
Julien G Avatar asked Nov 15 '11 19:11

Julien G


1 Answers

I had the same problem. My solution: Change table name in the create table query, exequte it and then rename the table.

Then, you can also drop this table and after it create it without getting error.

like image 169
Lexxtor Avatar answered Oct 05 '22 22:10

Lexxtor