我有整个xampp / mysql文件夹的备份.如何在全新安装的XAMPP上使用它恢复我的旧数据库?
简单地将旧的xampp / mysql文件夹复制到新的xampp会导致mysql错误,例如:
InnoDB: Table veno/sls37_finder_links_termsc in the InnoDB data
dictionary has tablespace id 1171, but tablespace with that id or name
does not exist. Have you deleted or moved .ibd files? This may also be
a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files
MySQL automatically removed, but the table still exists in the InnoDB
internal data dictionary.
解决方法:
You cannot copy a database folder that has InnoDB tables because
InnoDB storage engine maintains a symbiotic relationship between the
InnoDB tables’ physical files (frm and .ibd) and the data dictionary.
您可以尝试(InnoDB部分):https://dba.stackexchange.com/questions/57120/recover-mysql-database-from-data-folder-without-ibdata1-from-ibd-files/57157#57157
建议:在您的情况下,可能为时已晚,但是,在移至另一台服务器之前,最好将数据库导出到sql文件并从phpmyadmin,Mysql Workbech,SQLyog或终端导入
出口:
mysqldump -u user -p password database_name > database_name.sql
进口
mysql -u user -p password database_name < database_name.sql