如何从物理文件还原MySQL数据库 [英] How to Restoring MySQL database from physical files

查看:166
本文介绍了如何从物理文件还原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.

预先感谢

推荐答案

我找到了解决方法

  1. 安装新的xampp
  2. 从以下位置复制您的旧数据库文件夹 xampp \ mysql \ data \ databasefolder粘贴到正在运行的xampp文件夹中
    C:\ xampp \ mysql \ data
  3. 在那之后停止mysql和apache服务,然后备份您正在运行的xampp文件ib_logfile0,ib_logfile1和ibdata1并存储在安全的地方
  4. 然后从旧版本复制相同文件(ib_logfile0,ib_logfile1和ibdata1) xampp \ mysql \ data \并粘贴到正在运行的xampp服务器C:\ xampp \ mysql \ data \
  5. 启动mysql和apache服务打开CMD Fire命令 C:\ xampp \ mysql \ bin> mysqldump -u dbusername -p dbpassword dbname> D:\ exportdb.sql
  6. 停止mysql和apache服务并恢复主ib_logfile0,ib_logfile1和ibdata1文件(检查步骤3)
  7. 然后再次启动服务并打开 http://localhost/phpmyadmin/并从D导入数据库备份: \ exportdb.sql 现在您的备份正在工作:)
  1. Install new xampp
  2. Copy your old database folder from xampp\mysql\data\databasefolder to Paste in your running xampp folder
    C:\xampp\mysql\data
  3. After that stop mysql and apache service then backup your running xampp files ib_logfile0,ib_logfile1 and ibdata1 and store in safe place
  4. Then Copy same file (ib_logfile0,ib_logfile1 and ibdata1) from old xampp\mysql\data\ and paste in your running xampp server C:\xampp\mysql\data\
  5. Start mysql and apache service Open CMD Fire command C:\xampp\mysql\bin>mysqldump -u dbusername -p dbpassword dbname>D:\exportdb.sql
  6. stop mysql and apache service and restore your main ib_logfile0,ib_logfile1 and ibdata1 file (check Step 3)
  7. after than again start service and open http://localhost/phpmyadmin/ and import database backup from D:\exportdb.sql Now your backup is working :)

这篇关于如何从物理文件还原MySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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