I am using windows XP. I am creating a table in phpMyAdmin using its built-in create table feature,
my database name is ddd
.
It generates the following code:
CREATE TABLE `ddd`.`mwrevision` (
`asd` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`sddd` INT NOT NULL
) ENGINE = INNODB;
and the following error shows up:
MySQL said:
#1146 - Table 'ddd.mwrevision' doesn't exist
What might be the problem?
I got this issue after copying mytable.idb table file from another location. To fix this problem I did the following:
Copy mytable.idb
Restart MySql
For me it was a table name upper/lower case issue. I had to make sure that table case name matched in a delete query, table
notifications
was not the same asNotifications
. I fixed it by matching table name case with query and what MySQLWorkbench reported.What is wierd is that this error showed up in a worked sql statement. Don't know what caused this case sensitivity. Perhaps an auto AWS RDS update.
I encountered the same problem today. I was trying to create a table
users
, and was prompted thatERROR 1146 (42S02): Table users doesn't exist
, which did not make any sense, because I was just trying to create the table!!I then tried to drop the table by typing
DROP TABLE users
, knowing it would fail because it did not exist, and I got an error, sayingUnknown table users
. After getting this error, I tried to create the table again, and magically, it successfully created the table!My intuition is that I probably created this table before and it was not completely cleared somehow. By explicitly saying
DROP TABLE
I managed to reset the internal state somehow? But that is just my guess.In short, try DROP whatever table you are creating, and CREATE it again.
In my case, MySQL's parameter;
lower_case_table_names
was configured= 0
.It causes queries related with using upper cases will not work.
The reason I was facing this was because I had two "models.py" files which contained slightly different fields. I resolved it by:
Restarting MySQL works fine for me.