How to export/Import Database via Command line

Export  Mysql Database:-

To export your MySQL database using mysqldump. Here’s an example -

1
mysqldump -uUSERNAME -pPASSWORD DATABASENAME > db-backup.sql

Please replace USERNAME, PASSWORD, and databasename with your MySQL database details. Also, the filename database-backup.sql can be changed to anything you like.

Press the Enter key to run the command.

Import Mysql Database:-

To import a MySQL database we’ll use the mysql command. Here’s an example of the full command to import your database:

1
mysql -uUSERNAME -pPASSWORD DATABASENAME < db-backup.sql

Please replace USERNAME, PASSWORD, and DATABASENAME with your MySQL database details. The database has to exist for the import to run.

 

  • 0 Utilizadores acharam útil
Esta resposta foi útil?

Artigos Relacionados

PostgreSQL Database Replication

Database Replication with PostgreSQL 9 Replication is a basic technology for any database...

Scheduling Databases Backups

Scheduling Database Backups Scheduled backups are data backup processes which proceed...

MongoDB Database Backups

Create an environment 1. Log into your Apiqcloud account and click Create environment. 2. As...

Database Configuration

Database Configuration Below you will see the list of the configuration files available for...

PostgreSQL Database Backups

Automatic PostgreSQL Backups   The instruction below shows how to configure automatic...