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?
Column names must be unique in the table. You cannot have two columns named
asd
in the same table.I had the same issue. It happened after windows start up error, it seems some files got corrupted due to this. I did import the DB again from the saved script and it works fine.
Today i was facing same problem. I was in very difficult situation but what id did i create a table with diffrent name e.g (modulemaster was not creating then i create modulemaster1) and after creating table i just do the rename table.
As pprakash mentions above, copying the table.frm files AND the ibdata1 file was what worked for me. (I would have just commented on that comment but this SO requirement for 50 points means I have to provide a solution, even if it's just a rehash of an existing one ... weird.)
In short:
After that, all was well. (Don't forget to backup if you have success!)
Recently I had same problem, but on Linux Server. Database was crashed, and I recovered it from backup, based on simply copying
/var/lib/mysql/*
(analog mysql DATA folder in wamp). After recovery I had to create new table and got mysql error #1146. I tried to restart mysql, and it said it could not start. I checked mysql logs, and found that mysql simply had no access rigths to its DB files. I checked owner info of /var/lib/mysql/*, and got'myuser:myuser'
(myuser is me). But it should be'mysql:adm'
(so is own developer machine), so I changed owner to 'mysql:adm'. And after this mysql started normally, and I could create tables, or do any other operations.So after moving database files or restoring from backups check access rigths for mysql.
Hope this helps...
I had the same problem and can't get a good tip for this over the web, so I shared this for you and for all who needs.
In my situation I copy a database (all files: frm, myd) to the data folder in MySQL data folder (using Wamp at home). All thing was OK until I want to create a table and have the error
#1146 Table '...' doesn't exist!
.I use Wamp 2.1 with MySQL version 5.5.16.
My solution:
Export the database to file;
verify if exported file is really OK!!;
drop the database where I have issues;
create a new database with the same name that the last;
import the file to the database.
FOR ME IS PROBLEM SOLVED. Now I can create tables again without errors.