Code: Select all
mysqldump database_name > data_dump.sql
Code: Select all
mysqldump -h localhost -u mysqlUsername --password='somepass' database_name > data_dump.sql
- hostname - it's localhost if you are dumping database from the same server
- mysqlUsername - The username for MySQL.
- password - The password of MySQL user.
- database_name - The name of the database you want to backup.
- data_dump.sql - The file name for your backup dump.
To export only specific tables:
Code: Select all
mysqldump database_name --tables table1 table2 table3 > data_dump.sql
Here you can find how to IMPORT sql dump file to the database: viewtopic.php?t=612