Wednesday, August 29, 2012

Backup and restore MySQL

Backup and restore MySQL 

backup:
mysqldump -uroot -pXXXXXX db_name > db_name.mysql

restore:
mysql  -uroot -pXXXXXX db_name < db_name.mysql

1 comment:

  1. mysqldump --add-drop-table --extended-insert --force --log-error=error.log -uUSER -pPASS DB_NAME | ssh -C host@server "mysql -uUSER -pPASS NEW_DB_NAME"

    ReplyDelete