PDA

View Full Version : How to Back Up and Restore a MySQL Database?



MelissaCaddy1
09-16-2015, 10:33 AM
Please share the commands for creating and restoring database backups.

Fli
09-17-2015, 10:02 AM
If You are having Linux server, you can do it from within command line: http://internetlifeforum.com/mysql-apache-php/471-how-backup-restore-mysql-dump-file-linux-command-line/
Else backup can be usually made from within your hosting control panel..

admissioninfo123
03-16-2017, 02:31 AM
Please try the below steps ...
Open phpMyAdmin.
Select your database by clicking the database name in the list on the left of the screen.
Click the Export link. ...
In the Export area, click the Select All link to choose all of the tables in your database.

tivanov
08-10-2017, 07:08 PM
Create dump:

mysqldump db_name table_name > db.table.sql
Restore dump:

mysql db_name < db_name.sql

Fli
08-14-2017, 07:10 AM
mysqldump db_name table_name > db.table.sql
To dump whole database instead of just one table, try:

mysqldump -u databaseusername -p databasename > db.sql

kumkum
05-06-2022, 06:51 PM
If you want to backup and restore of MySQL database then you can run command:
You can run below command:
mysqldump db_name > db_name.sql

If you want to restore backup then you can run below command:
mysql db_name < db_name.sql

For more details regarding this, you can manage MySQL database (https://hoststud.com/resources/steps-to-manage-mysql-database-backup.372/).

HifiveHost
06-06-2022, 04:14 AM
You can run below command:-
--> mysqldump database_name > database_name.sql


If you want to restore backup then you can run below command:-
--> mysql database_name < database_name.sql

myresellerhome
07-12-2022, 05:00 AM
In order to protect your MySQL database from accidental or malicious deletion, you should use a backup. With a backup of your database, you can restore it to any point in time if necessary. There are many methods for backing up and restoring a MySQL database, so read on for information on the most popular methods.

One popular method for backing up and restoring a MySQL database is using the mysql client command line utility. To back up a MySQL database using this method, first create a local copy of your database by running the following command:

mysql -u root -p <database_name> <backup_directory>
where <database_name> is the name of your database and <backup_directory> is the directory where you want to store the backup file.