How to quickly back up and restore a database with phpMyAdmin

2 years ago 386

If a web-based GUI is amended suited to your admin skills, Jack Wallen wants to amusement you however to backmost up and reconstruct your MySQL/MariaDB databases with 1 of the easiest tools connected the market.

database head  working

Image: iStock/gorodenkoff

Many of your concern processes beryllium connected databases. Should 1 of those databases fail, your workflow could travel to a standstill. That would outgo you money, an result you surely bash not want.

To debar that, you request to backmost up those databases. I've already walked you done the process of doing truthful from the bid line. This is astir decidedly a method you should know. But determination mightiness beryllium times erstwhile you privation to enactment with a spot much efficiency, specified arsenic by mode of a web-based GUI similar phpMyAdmin. That, my friends, is precisely what I'm going to amusement you today.


After you work however casual this is, you mightiness ne'er spell backmost to the terminal for this task.

Let's get to work.

SEE: 40+ unfastened root and Linux presumption you request to know (TechRepublic Premium)

What you'll request

You'll request 3 things to marque this happen:

  • A moving lawsuit of phpMyAdmin
  • A idiosyncratic with afloat entree to the databases (such arsenic the phpmyadmin user)
  • A database to backmost up

With those things astatine the ready, let's backmost up and reconstruct that data.

How to backmost up a database with phpMyAdmin

The archetypal happening we'll bash is backmost up the database. Log successful to phpMyAdmin and prime the database to beryllium backed up from the near navigation (Figure A).

Figure A

phpmyadmina.jpg

I'm going to backmost up my nextcloud database.

Once you've selected the database, spell to the main pane and prime the Export tab (Figure B).

Figure B

phpmyadminb.jpg

The export tab is wherever the backup process is found.

In the adjacent model (Figure C), marque definite to prime Quick, and SQL format. 

Figure C

phpmyadminc.jpg

You tin disregard the export template model for basal backups.

Click Go and you'll beryllium prompted to prevention the .sql record from the export. Save the record and the backup is complete.

One happening to support successful caput is that phpMyAdmin can't regularly backmost up your databases. Because of this, you indispensable manually backmost them up. I'd suggest getting successful the wont of doing this daily.

How to reconstruct from a backup

Should thing spell incorrect with your database (let's anticipation it ne'er does), you tin reconstruct it from your latest backup but it's not rather arsenic straightforward arsenic is the backup.

First off, you person to delete the failed backup from phpMyAdmin. To bash that, click connected the SQL tab and, successful the query pane (Figure D — the substance country supra the Submit Query button) type:

drop database NAME;

Where NAME is the sanction of the database to beryllium deleted.

Once you've done that, you past request to make a caller database with the aforesaid name. Go to the main phpMyAdmin model and spell to the Databases tab. Type the sanction of the caller database and click Create (Figure D).

Figure D

phpmyadmind.jpg

Recreating the deleted database.

Once the database has been created, prime it from the near navigation and click the Import tab. In this caller model (Figure E), click the Browse fastener and past find the .sql backup record you downloaded from the export.

Figure E

phpmyadmine.jpg

Restoring a MySQL database utilizing the phpMyAdmin import tool.

This enactment volition instrumentality immoderate clip (depending connected however ample the database is). When the import completes, you should spot each of the tables listed successful the near navigation and you're bully to go. Although this process isn't rather arsenic elemental arsenic erstwhile moving from the bid line, it volition get the occupation done and bash truthful with the assistance of a useful GUI.

Open Source Weekly Newsletter

You don't privation to miss our tips, tutorials, and commentary connected the Linux OS and unfastened root applications. Delivered Tuesdays

Sign up today

Also spot

Read Entire Article