简体   繁体   English

备份后不存在MySQL错误1146表

[英]MySQL ERROR 1146 table doesn't exist after backup

In school after every lesson I need to backup my database so I copy database from mysql data directory and when I work again I paste it back in. 上完每堂课后,我需要在学校中备份数据库,以便从mysql数据目录复制数据库,然后在我再次工作时将其粘贴回去。

The thing is that I always get error that my tables don't exist although when I type show tables; 问题是,尽管我键入show表,但我总是会得到表不存在的错误。 it lists them. 它列出了它们。

mysql> show tables;
+--------------------------+
| Tables_in_database_name  |
+--------------------------+
| table_name               |
+--------------------------+
1 row in set (0.00 sec)

I get the error when I type something like this for example: 例如,当我输入类似以下内容时,我会收到错误消息:

describe table_name;
ERROR 1146 (42502): Table 'database_name.table_name' doesn't exist

Is there a way to fix this or what would be the proper way to backup my database? 有没有办法解决这个问题,或者什么是备份我的数据库的正确方法?

If you used a InnoDB table, and you just copied the database_name file, you will get the crazy error. 如果您使用InnoDB表,并且刚刚复制了database_name文件,则将出现疯狂的错误。

What you need to do is to copy your database_name file along with ib* files. 您需要做的是将您的database_name文件与ib *文件一起复制。 Those ib* files are in the root of the MySQL datadir (like ibdata1, ib_logfile0, or ib_logfile1). 这些ib *文件位于MySQL数据目录的根目录中(例如ibdata1,ib_logfile0或ib_logfile1)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 创建表后出现MySQL错误消息:#1146-表&#39;&#39;phpmyadmin.pma_table_uiprefs&#39;不存在 - MySQL error message after creating table: #1146 - Table ''phpmyadmin.pma_table_uiprefs' doesn't exist 错误1146:mysql Phpmyadmin中的表&#39;#__content&#39;不存在&#39; - Error 1146: table '#__content' doesn't exist' in mysql Phpmyadmin Python / MySQL:编程错误 1146 - 表不存在 - Python / MySQL : Programming error 1146 - Table doesn't exist MySQL:错误 1146 表不存在...尽管它确实存在 - MySQL: ERROR 1146 table doesn't exist...although it does Django-MySQL:1146表不存在 - Django - MySQL : 1146 Table doesn't exist 错误:1146 - 表“X”不存在 - Error: 1146 - Table 'X' doesn't exist MySQL中RENAME TABLE语句后的DROP TRIGGER语句导致“错误代码:1146。表&#39;testschema.TestRenamed&#39;不存在” - DROP TRIGGER statement after RENAME TABLE statement in MySQL results in “Error Code: 1146. Table 'testschema.TestRenamed' doesn't exist” 1146表不存在 - 1146 Table doesn't exist 错误代码 1146 表 &#39;<table_name> &#39; 不存在 MySql 错误 - Error code 1146 Table '<table_name>' doesn't exist MySql error CodeIgniter-错误号:1146(执行“ CREATE TABLE”命令后该表不存在) - CodeIgniter - Error Number: 1146 (Table doesn't exist after execute a “CREATE TABLE” command)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM