Review Section 2.10, “Upgrading MySQL”, for additional information
on upgrading MySQL that is not specific to Windows.
You should always back up your current MySQL installation
before performing an upgrade. See Section 5.9.1, “Database Backups”.
Download the latest Windows distribution of MySQL from
https://dev.mysql.com/downloads/.
-
Before upgrading MySQL, you must stop the server. If the
server is installed as a service, stop the service with the
following command from the command prompt:
C:\> NET STOP MYSQL
If you are not running the MySQL server as a service, use
the following command to stop it:
C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin" -u root shutdown
Note: If the MySQL
root
user account has a password, you
need to invoke mysqladmin with the
-p
option and supply the password when
prompted.
-
When upgrading to MySQL 5.1 from a version
previous to 4.1.5, or when upgrading from a version of MySQL
installed from a Zip archive to a version of MySQL installed
with the MySQL Installation Wizard, you must manually remove
the previous installation and MySQL service (if the server
is installed as a service).
To remove the MySQL service, use the following command:
C:\> C:\mysql\bin\mysqld --remove
If you do not remove the existing
service, the MySQL Installation Wizard may fail to properly
install the new MySQL service.
If you are using the MySQL Installation Wizard, start the
wizard as described in
Section 2.3.3, “Using the MySQL Installation Wizard”.
If you are installing MySQL from a Zip archive, extract the
archive. You may either overwrite your existing MySQL
installation (usually located at
C:\mysql
), or install it into a
different directory, such as C:\mysql4
.
Overwriting the existing installation is recommended.
If you were running MySQL as a Windows service and you had
to remove the service earlier in this procedure, reinstall
the service. (See Section 2.3.11, “Starting MySQL as a Windows Service”.)
Restart the server. For example, use NET START
MySQL if you run MySQL as a service, or invoke
mysqld directly otherwise.
If you encounter errors, see
Section 2.3.13, “Troubleshooting a MySQL Installation Under Windows”.