How to backup mysql database xampp

How to backup mysql database xampp

  • January 4, 2022
  • PHP

There are various scenarios when you are unable to export database through phpmyadmin in your XAMPP installation. Here you would need to restore your databases manually from the directories when you are unable to access PHPmyadmin.

Well if you have already installed the new XAMPP and you have the backup of your old XAMPP installation or /mysql folder then you are all set.

Please follow steps below to restore databases from old XAMPP installation

First of all its very important that you save the /mysql folder from your old xampp installation and also /htdocs folder for other files and directories. But we will talk about only databases here nothing else.

  1. First of all save the old XAMPP folder somewhere else.
  2. Now you have to install new XAMPP.
  3. After you have tested XAMPP is correctly installed and working fine.
  4. Now copy /xampp/mysql/data/ibdata1 from old installation to new installation.
  5. Now copy all folders of databases except /mysql/, /performance_schema/, /phpmyadmin/ from xampp/mysql/databa/ and put them in new installation
  6. Restart XAMPP and run PHPmyadmin your all databases are there.

Sometime you get problem like Error: MySQL shutdown unexpectedly. You can visit to try to resolve issues.

If you need visual presentation kindly check this video.

XAMPP includes phpMyAdmin, an open-source, browser-based tool for managing MySQL database servers. This guide walks you through the process of backing up and restoring a MySQL database using phpMyAdmin.

This guide assumes that you already have a PHP application that uses a MySQL database deployed on XAMPP. The example application used in this guide is WordPress, although the steps outlined below will work for any application.

To backup a MySQL database using phpMyAdmin, follow these steps:

  1. Browse to http://localhost/phpMyAdmin or http://127.0.0.1/phpMyAdmin. If required, log in using your database access credentials. On a fresh XAMPP installation without any changes, you can log in as root with a blank password.

  2. Select the database to be backed up from the list in the left navigation pane. In this case, we’re backing up the WordPress database, which is named bitnami_wordpress.

    How to backup mysql database xampp

  3. Select the "Export" command in the top navigation bar.

  4. On the resulting page, select "Quick" as the export method and "SQL" as the output format. Click "Go" to proceed.

    How to backup mysql database xampp

phpMyAdmin will export the database to a text file as a series of SQL statements. Once done, the browser will prompt you to download it to the desktop. This text file is your backup, so store it safely!

How to backup mysql database xampp

At a later point, you may wish to restore the database. To restore the data to a fresh MySQL database using phpMyAdmin, follow these steps:

  1. Browse to http://localhost/phpMyAdmin or http://127.0.0.1/phpMyAdmin. If required, log in using your database access credentials.

  2. Select the "New" command in the left navigation pane.

    How to backup mysql database xampp

  3. On the resulting page, enter a name for the new database (in this case, myblog). Select the collation "utf8_general_ci". Click "Create" to create the database.

    How to backup mysql database xampp

    Once the database has been created, it will appear in the left navigation pane.

    How to backup mysql database xampp

  4. Select the new database from the left navigation pane. In the resulting page, select the "Import" command in the top navigation bar.

  5. Click the "Browse…​" button and select the backup file created earlier. Click "Go" to proceed.

    How to backup mysql database xampp

    phpMyAdmin will import the data from the backup file. Once complete, you will see a screen indicating the status of the import.

    How to backup mysql database xampp

If you browse the contents of the database, you should now see your original data.

How to backup mysql database xampp

You should now update your application’s configuration and point it to your newly-created database. For example, with the Bitnami WordPress module, you will need to edit the wp-config.php file in the apps\wordpress\htdocs\ subdirectory of your XAMPP installation directory. Within this file, you will need to update the DB_NAME constant to use the new database name.

How to backup mysql database xampp

Note

By default, PHP (and therefore phpMyAdmin) is configured to only accept uploads up to 2 MB in size. If your database is larger than this, you need to modify the PHP configuration file to accept a larger upload size. To do this, edit the php.ini file in the php\ subdirectory of your XAMPP installation directory and increase the values of the post_max_size and upload_max_filesize variables. Save your changes and restart Apache for the changes to take effect.

How do I backup an entire MySQL database?

Step 1: Create a MySQL Database Backup.
Open phpMyAdmin. On the directory tree on the left, click the database you want to back up. ... .
Click Export on the menu across the top of the display. You'll see a section called “Export Method.” Use Quick to save a copy of the whole database. ... .
Click Go..

What is the best way to backup MySQL database?

How to Backup MySQL Database.
Open phpMyAdmin from your web hosting control panel like cPanel..
Select the database from the sidebar navigation panel of phpMyAdmin..
Click the Export link from the top navigation bar..
Choose Custom option in the Export page..
Select the tables that you want to backup..

Where is MySQL stored XAMPP?

1 Answer. You will get all databases at the "xampp/var/mysql". You can copy the complete folder to the new setup and it will show you all databases.

How do I transfer my MySQL database to another computer using XAMPP?

The answer is actually a lot simpler: Make sure Apache and MySQL are turned off. In your new XAMPP installation, delete the mysql\data and mysql\backup folders. Copy the mysql\data and mysql\backup folders in your old XAMPP installation to the new installation.