如何从物理文件恢复 MySQL 数据库
不幸的是,我在我的 windows 机器上卸载了 Xampp,/xamp/mysql/data 文件夹中有大约 50 个数据库.我没有备份脚本,但我有 Xamp/mysql/data 文件夹的副本.如何使用该数据目录恢复 MySQL 数据库.
Unfortunately I uninstalled Xampp in my windows machine, there are about 50 databases in /xamp/mysql/data folder. I have not taken backup script, but I have a copy of Xamp/mysql/data folder.How can I restore MySQL Databases using that Data Directory.
提前致谢
推荐答案
我正在寻找解决方案
- 安装新的 xampp
- 从xamppmysqldatadatabasefolder 粘贴到您正在运行的 xampp 文件夹中
C:xamppmysqldata - 然后停止 mysql 和 apache 服务,然后备份您正在运行的 xampp 文件 ib_logfile0、ib_logfile1 和 ibdata1 并存储在安全的地方
- 然后从旧文件复制相同的文件(ib_logfile0、ib_logfile1 和 ibdata1)xamppmysqldata 并粘贴到您正在运行的 xampp 服务器 C:xamppmysqldata
- 启动mysql和apache服务Open CMD Fire命令C:xamppmysqlin>mysqldump -u dbusername -p dbpassword dbname>D:exportdb.sql
- 停止 mysql 和 apache 服务并恢复您的主 ib_logfile0、ib_logfile1 和 ibdata1 文件(检查第 3 步)
- 再次启动服务并打开 http://localhost/phpmyadmin/ 并从 D: 导入数据库备份导出数据库.sql现在您的备份正在运行 :)
- Install new xampp
- Copy your old database folder from
xamppmysqldatadatabasefolder to Paste in your running xampp folder
C:xamppmysqldata - After that stop mysql and apache service then backup your running xampp files ib_logfile0,ib_logfile1 and ibdata1 and store in safe place
- Then Copy same file (ib_logfile0,ib_logfile1 and ibdata1) from old xamppmysqldata and paste in your running xampp server C:xamppmysqldata
- Start mysql and apache service Open CMD Fire command C:xamppmysqlin>mysqldump -u dbusername -p dbpassword dbname>D:exportdb.sql
- stop mysql and apache service and restore your main ib_logfile0,ib_logfile1 and ibdata1 file (check Step 3)
- after than again start service and open http://localhost/phpmyadmin/ and import database backup from D:exportdb.sql Now your backup is working :)
相关文章