简体   繁体   English

MySql“表不存在”

[英]MySql “table doesnt exist”

I start with what I think is the beginning of my problem: 我从我认为是问题开始的地方开始:

I exported a mysql database from a online server to a local server so I could test on it without risk. 我将mysql数据库从在线服务器导出到本地服务器,这样就可以在没有风险的情况下对其进行测试。

But in XAMPP I couldn't restart the MySql Module. 但是在XAMPP中,我无法重新启动MySql模块。 The

11:02:54  [mysql]   Attempting to start MySQL app...

did nothing but throwing this error 除了抛出此错误外什么也没做

10:57:49  [mysql]   Error: MySQL shutdown unexpectedly.
10:57:49  [mysql]   This may be due to a blocked port, missing dependencies, 
10:57:49  [mysql]   improper privileges, a crash, or a shutdown by another method.
10:57:49  [mysql]   Press the Logs button to view error logs and check
10:57:49  [mysql]   the Windows Event Viewer for more clues
10:57:49  [mysql]   If you need more help, copy and post this
10:57:49  [mysql]   entire log window on the forums

I looked it up on the internet and the only working solution I found, was to delete the mysql/data/ibdata1 file before each startup. 我在互联网上进行了查找,发现的唯一可行的解​​决方案是在每次启动之前删除mysql / data / ibdata1文件。 I knew its a dirty solution but it worked and I didn't want to waste much time on it. 我知道它是一个肮脏的解决方案,但它行得通,我不想浪费太多时间。

Now the actual problem: I added a new table. 现在的实际问题是:我添加了一个新表。 After the next restart (including the delete of the ibdata1 file) I see the table on the left column in phpMyAdmin but when I click on the "+" its completly empty. 下次重新启动后(包括删除ibdata1文件),我在phpMyAdmin的左列中看到该表,但是当我单击“ +”时,它完全为空。 When I click on the name I get the error 当我单击名称时,出现错误

#1146 table doesnt exist

If I try to creat a new table with the same name, I get the same error. 如果尝试创建一个具有相同名称的新表,则会收到相同的错误。

This is the xampp logfile: 这是xampp日志文件:

2013-09-27 11:17:21 4284 [Note] Plugin 'FEDERATED' is disabled.
2013-09-27 11:17:21 21e8 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2013-09-27 11:17:21 4284 [Note] InnoDB: The InnoDB memory heap is disabled
2013-09-27 11:17:21 4284 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2013-09-27 11:17:21 4284 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-09-27 11:17:21 4284 [Note] InnoDB: Not using CPU crc32 instructions
2013-09-27 11:17:21 4284 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2013-09-27 11:17:21 4284 [Note] InnoDB: Completed initialization of buffer pool
2013-09-27 11:17:21 4284 [Note] InnoDB: The first specified data file C:\xampp\mysql\data\ibdata1 did not exist: a new database to be created!
2013-09-27 11:17:21 4284 [Note] InnoDB: Setting file C:\xampp\mysql\data\ibdata1 size to 10 MB
2013-09-27 11:17:21 4284 [Note] InnoDB: Database physically writes the file full: wait...
2013-09-27 11:17:21 4284 [Note] InnoDB: Setting log file C:\xampp\mysql\data\ib_logfile101 size to 5 MB
2013-09-27 11:17:21 4284 [Note] InnoDB: Setting log file C:\xampp\mysql\data\ib_logfile1 size to 5 MB
2013-09-27 11:17:21 4284 [Note] InnoDB: Renaming log file C:\xampp\mysql\data\ib_logfile101 to C:\xampp\mysql\data\ib_logfile0
2013-09-27 11:17:21 4284 [Warning] InnoDB: New log files created, LSN=45781
2013-09-27 11:17:21 4284 [Note] InnoDB: Doublewrite buffer not found: creating new
2013-09-27 11:17:21 4284 [Note] InnoDB: Doublewrite buffer created
2013-09-27 11:17:22 4284 [Note] InnoDB: 128 rollback segment(s) are active.
2013-09-27 11:17:22 4284 [Warning] InnoDB: Creating foreign key constraint system tables.
2013-09-27 11:17:22 4284 [Note] InnoDB: Foreign key constraint system tables created
2013-09-27 11:17:22 4284 [Note] InnoDB: Creating tablespace and datafile system tables.
2013-09-27 11:17:22 4284 [Note] InnoDB: Tablespace and datafile system tables created.
2013-09-27 11:17:22 4284 [Note] InnoDB: Waiting for purge to start
2013-09-27 11:17:22 4284 [Note] InnoDB: 5.6.11 started; log sequence number 0
2013-09-27 11:17:22 4284 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 9dce5432-2755-11e3-835a-20689d9d84a8.
2013-09-27 11:17:22 4284 [Note] Server hostname (bind-address): '*'; port: 3306
2013-09-27 11:17:22 4284 [Note] IPv6 is available.
2013-09-27 11:17:22 4284 [Note]   - '::' resolves to '::';
2013-09-27 11:17:22 4284 [Note] Server socket created on IP: '::'.
2013-09-27 11:34:15 3928 [Note] Plugin 'FEDERATED' is disabled.
2013-09-27 11:34:15 12d0 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2013-09-27 11:34:15 3928 [Note] InnoDB: The InnoDB memory heap is disabled
2013-09-27 11:34:15 3928 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2013-09-27 11:34:15 3928 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-09-27 11:34:15 3928 [Note] InnoDB: Not using CPU crc32 instructions
2013-09-27 11:34:15 3928 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2013-09-27 11:34:15 3928 [Note] InnoDB: Completed initialization of buffer pool
2013-09-27 11:34:15 3928 [Note] InnoDB: Highest supported file format is Barracuda.
2013-09-27 11:34:15 3928 [Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 2203529 in the ib_logfiles!
2013-09-27 11:34:15 3928 [Note] InnoDB: Database was not shutdown normally!
2013-09-27 11:34:15 3928 [Note] InnoDB: Starting crash recovery.
2013-09-27 11:34:15 3928 [Note] InnoDB: Reading tablespace information from the .ibd files...
2013-09-27 11:34:15 3928 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_index_stats uses space ID: 2 at filepath: .\mysql\innodb_index_stats.ibd. Cannot open tablespace mydatabase/blackboard which uses space ID: 2 at filepath: .\tum_mitfahrer_app\blackboard.ibd
InnoDB: Error: could not open single-table tablespace file .\tum_mitfahrer_app\blackboard.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.

its running on windows 8. could be something about missing permissions, but I reinstalled xampp from c:\\program files\\xampp to c:\\xampp -> same problem. 它在Windows 8上运行。可能与缺少权限有关,但是我将xampp从c:\\ program files \\ xampp重新安装到c:\\ xampp->相同的问题。 I have to delete ibdata1 to get it started, and every new table I create is gone after that. 我必须删除ibdata1才能开始使用,然后创建的每个新表都消失了。

It seems like a known bug in MySQL 5.6. 似乎是MySQL 5.6中的已知错误
They also mention a workaround: 他们还提到了一种解决方法:

[27 Nov 2012 8:39] Sunny Bains This is a duplicate of bug#67179. [2012年11月27日8:39] Sunny Bains这是Bug#67179的重复。 Just different side effect. 只是不同的副作用。 The Windows installer ? Windows安装程序? apparently copied the .ibd files around and that caused the problem. 显然是在周围复制了.ibd文件,从而导致了问题。 The ones in data/mysql. 那些在数据/ MySQL中。 If you want to recover your files you will have to do the following: 如果要恢复文件,则必须执行以下操作:

  1. Delete the data/mysql/*.ibd files and the corresponding .frm files for the .ibd files 删除data / mysql / *。ibd文件以及.ibd文件的相应.frm文件
  2. Start the server with --skip-slave-start 使用--skip-slave-start启动服务器
  3. You should be able to access and backup your data 您应该能够访问和备份数据

What I noticed was that on shutdown, you will get another failure. 我注意到的是,在关机时,您还会遇到另一个故障。 I need to investigate the cause of this other issue. 我需要调查另一个问题的原因。 I will post an update on this later. 我稍后会发布更新。

If it doesn't work try Restoring MySQL InnoDB Files on Windows which is slightly more XAMPP related. 如果它不起作用,请尝试在Windows上还原与XAMPP有关的MySQL InnoDB文件

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM