MySQL backup upgrade and restore

Before an upgrade from MySQL 5.0.x to MySQL 5.1 I did a backup of all databases. First I created a folder without any spaces in the path:

C:\mysql

Then I start the command prompt (cmd) and run:

mysqldump -u root -p -all-databases > C:\mysql\backup.sql

Enter the password when MySQl ask for it, and when MySQL is done, I uninstall MySQL 5.0.x and installs the MYSQL 5.5 by MS Web Platform Installer.

When done I run the following in the command prompt:

mysql -u root -p < C:\mysql\backup.sql

...and with a little bit of luck you have all data back again. Note that it might be possible to upgrade from MySQL 5.0.x to MySQL 5.1, but I was first trying to install MySQL 5.5 and that was not possible to upgrade to from 5.0.x, so I uninstalled it. But when I was going to install 5.5 with MS Web Platform Installer it was not available, seems to be a common issue with 5.5 versions at MS.

Knowledge keywords: