简体   繁体   中英

Xampp Mysql and Apache not Working - How to backup database

I'm having trouble with my Mysql and Apache server here for a week already. Tried to look for every possible solutions in the internet like changing ports and everything. Still no luck. I would like to reinstall Xampp, the problem is, I have important databases which do not have any backups yet. Is there a way to backup these databases without having my apache and mysql started?

It depends a bit on the type of storage engines you're using.

MyIsam

MyISAM tables are stored as files, so it is easy to do a backup by copying files ( *.frm , *.MYD , and *.MYI files). In a typical XAMPP installation they can be found under c:/your/path/to/xampp/mysql/data/ .

InnoDB

Have a look at the manual :

  1. Copy all InnoDB data files (ibdata files and .ibd files) into a safe place.
  2. Copy all the .frm files for InnoDB tables to a safe place.
  3. Copy all InnoDB log files (ib_logfile files) to a safe place.
  4. Copy your my.cnf configuration file or files to a safe place.

However, if you have important databases, it is advised to think about a backup strategy before problems occur. MySQL offers a variety of backup strategies from which you can choose the methods that best suit the requirements for your installation.

Yes, you can just copy the data files. for innodb you need the ibdata1 (or similar) file. For MyISAM you will see 3 files (different extensions) for each database and the filename match the database names. If it is MyISAM then you can just copy these files back into the data directory on your new install and it will just work.

The other thing you should do is not use WAMP! It is easy enough to set up from scratch and much easier to figure out when things don't work.... you just need to read a little bit.

Copy all the files in your htdocs to another location first, duplicate the database organizers from information envelope and erase xampp then re-install it. You also need to delete the ib_logfile0, ib_logfile1 files from the data folder inside mysql folder. Read here for further procedure https://dba.stackexchange.com/questions/3437/lost-tables-in-drupal-site-database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM