Moving Tables from One MySQL Database to Another Using Command Line Interface

Moving all of the tables from one MySQL database to a different is very simple. It will be done using phpMyAdmin to dump the database to a .sql file. However, during this tutorial, we are going to dump the database to a .sql file with the help of the command line interface. With the command line, you’ll complete your task quicker as compare to the phpMyAdmin technique.

In order to start out, you wish to be a user who has full privileges in each the databases or should be a root user. Usually, it’s not necessary to use username and password once dumping a MySQL database in Linux system cPanel Hosting. It won’t prompt you for the password and automatically takes the username and password . Follow the steps as given below:

How to Dump the MySQL Database to an SQL file

Enter the following command to dump a database:

mysqldump database_name > Database_name.sql