升级到新版本的XAMPP后,从文件中恢复mysql数据库 [英] Recover a mysql database from files after upgrading to new version of XAMPP

查看:145
本文介绍了升级到新版本的XAMPP后,从文件中恢复mysql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello! I have a problem with a MySQL database that I haven’t been able to solve no matter how much I tried, either with internet guides or with free tools. I really don’t want to pay hundreds of dollars to a company so please, if anyone knows of a solution, help me because I’m desperate.

I was running XAMPP 7.1.22 where I had said database and I decided to install XAMPP 7.2.10 without backing up the database. After that, the site wasn’t working so I figured the problem was the database. And indeed PHPMyAdmin wouldn’t recognize it. I reinstalled the previous version of XAMPP and the database was there but unfortunately I could only see the tables. The tables themselves were empty though. So no dump procedure worked and neither the site. Now all I have left is the folder with the database which contains all the .frm and the .ibd files, an .opt file, a .myd file and a .myi file. I also have the ibdata1 file. 

Any ideas or suggestions? Thank you very much for your time.





我尝试过:





What I have tried:

I haven’t been able to solve no matter how much I tried, either with internet guides or with free tools.

推荐答案

首先使用XAMPP停止我的MySQL服务



然后移动你的文件ib *文件和包含*的文件夹.frm文件到本地mysql数据文件夹
First of stopped my MySQL service using XAMPP’s

then move your files ib* files and the folder containing the *.frm files to the local mysql data folder
(C:\Program Files\xampp\mysql\data)



然后编辑my.cnf


then edit my.cnf

(located in C:\Program Files\xampp\mysql\bin)

并进行以下更改(从第66行开始或检查你的文件行):

and made the following changes (starting at line 66 or check your file for line ):

OLD:
skip-innodb
#innodb_data_home_dir = C:/Program Files/xampp/mysql/data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = C:/Program Files/xampp/mysql/data/
#innodb_log_arch_dir = C:/Program Files/xampp/mysql/data/
#set-variable = innodb_buffer_pool_size=16M
#set-variable = innodb_additional_mem_pool_size=2M
#set-variable = innodb_log_file_size=5M
#set-variable = innodb_log_buffer_size=8M
#innodb_flush_log_at_trx_commit=1
#set-variable = innodb_lock_wait_timeout=5




#skip-innodb
innodb_data_home_dir = C:/Program Files/xampp/mysql/data/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = C:/Program Files/xampp/mysql/data/
innodb_log_arch_dir = C:/Program Files/xampp/mysql/data/
set-variable = innodb_buffer_pool_size=16M
set-variable = innodb_additional_mem_pool_size=2M
set-variable = innodb_log_file_size=170M
set-variable = innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1
set-variable = innodb_lock_wait_timeout=50



将innodb_log_file_size设置为我日志的实际大小然后编辑文件,启动mysql服务的XAMPP批处理文件


set innodb_log_file_size to the actual size of my log file then edited the XAMPP batch file that starts the mysql service

(C:\Program Files\xampp\mysql_start.bat)



add -innodb_force_recovery = 6到mysqld调用结束。

现在该文件的第8行


add –innodb_force_recovery=6 to the end of the call to mysqld.
So line 8 of that file now

mysql\bin\mysqld –defaults-file=mysql\bin\my.cnf –standalone –console –innodb_force_recovery=6


在等待并尝试了很多之后,我决定回滚网站并再次添加缺少的内容。谢谢你的时间。
Well after waiting and trying a lot, I decided to roll back the site and add the missing content again. Thanks for your time.


这篇关于升级到新版本的XAMPP后,从文件中恢复mysql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆