Replace a database using mysqldump code example
Example 1: export all databases mysql
# Export
mysqldump -u root -p --all-databases > all.sql
Example 2: mysql dump restore
mysql -u [user] -p [database_name] < [filename].sql
# Export
mysqldump -u root -p --all-databases > all.sql
mysql -u [user] -p [database_name] < [filename].sql