Tuesday 6 November 2018

Mysql: mysql-error-1146 Bug? - Table 'xxx.xxxxx' doesn't exist


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?

 Answers



I also had same problem in past. All had happend after moving database files to new location and after updating mysql server. All tables with InnoDB engine disappeared from my database. I was trying to recreate them, but mysql told me 1146: Table 'xxx' doesn't exist all the time until I had recreated my database and restarted mysql service.
I think there's a need to read about InnoDB table binaries.




In my case I ran this command even if the table wasn't visible in PhpMyAdmin :
DROP TABLE mytable
then
CREATE TABLE....
Worked for me !




Check filenames.
You might need to create a new database in phpmyadmin that matches the database you're trying to import.




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:
  1. Shut your DB explorer client emphasized text(eg Workbench).
  2. Stop the MySQL service (Windows host).
  3. Make a safe copy of virtually everything!
  4. Save a copy of the table file(s) (eg mytable.frm) to the schema data folder (eg MySQL Server/data/{yourschema}).
  5. Save a copy of the ibdata1 file to the data folder (ie, MySQL Server/data).
  6. Restart the MySQL service.
  7. Check that the tables are now accessible, queryable, etc in your DB explorer client.
After that, all was well. (Don't forget to backup if you have success!)




run from CMD & %path%=set to mysql/bin
mysql_upgrade -u user -ppassword




The reason I was facing this was because I had two "models.py" files which contained slightly different fields. I resolved it by:
  1. deleting one of the models.py files
  2. correcting references to the deleted file
  3. then running manage.py syncdb




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.




In my case, MySQL's parameter; lower_case_table_names was configured = 0.
It causes queries related with using upper cases will not work.

0 comments:

Post a Comment