Importing and exporting a mysql database using the console, I think, is the most versatile and most convenient way, compared to the same phpmyadmin, which you need to install and configure. And work with the console takes a minimum of time.
Of course, you must have access to SSH, either directly to the console, if this is your local computer, or to VNC.
First you need to create a database .
# mysql -u username -p database_name <db.sql
# mysqldump -u username -p database_name > db.sql
Replace the values "username" and "database_name" with the user name and database name, respectively.
To export several databases, you can use the following command:
# mysqldump -uroot -p -B base_1 base_2 base_3 > db.sql
Where “base_1”, “base_2”, “base_3” are the names of the databases needed for copying, and “-B” is an indication that several databases are being copied.
Also, the mysqldump utility allows you to export all databases on the server into a single sql file. This is done by the command:
# mysqldump -uroot -p -A> alldb.sql