MySQL

MySQL Notes


Database backup

mysqldump -u userId -puserPassword --all-databases  >I:\MySQL\backup\abc.sql
or
mysqldump -u userId -puserPassword someDatabase  >I:\MySQL\backup\abc.sql
or
mysqldump -u userId -puserPassword --databases  dbOne [dbTwo dbThree...] >I:\MySQL\backup\abc.sql

Database restore

mysql -u userId -puserPassword -e "source I:/MySQL/backup/abc.sql"

No space after -p


Comments are closed.