Commands to export/import MySQL DB:
Run below commands from a command prompt:
To export a MySQL database:
mysqldump -P 3306 -h [ip_address] -u [uname] -p[pass] --routines db_name > db_backup.sql |
Note: Mentioning port is optional if default 3306 is used, and mentioning host is optional if the host is localhost. The exported file gets created in the folder form where you ran the command.
To import the MySQL database:
mysql -u [uname] -p[pass] -h [ip_address] db_name < db_backup.sql |