Home >Database >Mysql Tutorial >Mysql startup error after data migration
I don’t know why after work today, mysql has been unable to start. After struggling for a long time, I decided to reinstall it
My local server uses wamp. When reinstalling, I need to back up the data. I use the simplest and most crude backup method. , just go directly to the installation directory of mysql and make a copy of the data.
Then uninstall wamp and reinstall it. Data migration is to paste the data to the same location and replace it and it will be ok
But today After the migration, mysql cannot be started. Checking the log shows various errors
2014-11-13 13:40:29 5196 [Note] Plugin 'FEDERATED' is disabled.
2014-11-13 13:40: 29 5196 [Note] InnoDB: The InnoDB memory heap is disabled
2014-11-13 13:40:29 5196 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2014-11-13 13:40:29 5196 [ Note] InnoDB: Compressed tables use zlib 1.2.3
2014-11-13 13:40:29 5196 [Note] InnoDB: Not using CPU crc32 instructions
2014-11-13 13:40:29 16e4 InnoDB: Error: unable to create temporary file; errno: 2
2014-11-13 13:40:29 5196 [ERROR] Plugin 'InnoDB' init function returned error.
2014-11-13 13:40:29 5196 [ERROR] Plugin 'InnoDB' ' registration as a STORAGE ENGINE failed.
2014-11-13 13:40:29 5196 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-11-13 13:40:29 5196 [ERROR] Aborting
View After collecting all kinds of information, I came up with a crude method and deleted the files except the database folder and ibdata1 in the data directory, then restarted, and it was ok. The small green icon appeared and mysql started normally.
*Note: Be sure not to delete ibdata1. After checking the information, it was said that this is a very important file that saves innodb related data
Of course, as a girl blogger, she naturally has her own careful side, why did she delete the others? Can the file be started?
And during the migration process, the girl did various tests.
1. Only replace the database folder in data. After restarting, mysql can be started, but navicat is used to connect to the database. After that, the data table cannot be opened, and the data table does not exist (that is, data loss, related to the above ibdata1)
2. Replace the database folder and ibdata1 in the previously backed up data to the data directory, restart, mysql cannot start
3 .Delete ib_logfile0 and ib_logfile1, restart, mysql starts normally, and the connection database data table information is restored.