DB dump

myslqdump (mysql – mariadb)

EXPORT

export an entire database

$ mysqldump -u [username] -p --verbose db_name > db_backup.sql

export an entire database using gzip compression

$ mysqldump -u [username] -p[pass] --verbose db_name | gzip > db_backup.sql.gz

export from a remote database (presuming the MySQL server is on port 3306)

mysqldump -P 3306 -h [ip_address] -u [username] -p --verbose [database_name] > db_backup.sql

IMPORT

import sql data file

$ mysql -u [username] -p -h [db_ip_address_or_hostname] --verbose [database_name] < dumpData.sql

DROP

Drop a database

mysqladmin -u[username] -p[password] drop [database_name]