Primer – Installing MySQL on Windows

Goto http://www.mysql.com/ and download the latest version of MySQL Community Server MySQL. When you get to the download page, scroll under the login, and click "Take me to downloads". This is the free version: mysql-5.1.41-win32.msi (104.70 mb)

Once you have successfully downloaded the Windows version, installing it is a breeze… trust me!
(The installation steps below have be tested on Windows 7 the attached MySQL.msi)

  • Create a temporary directory called mysqltem.
  • Unzip the file to this directory.
  • After unzipping is over, you'll find a file called "setup.exe".
  • Close all programs
  • Click on Start – Run and browse to the setup file in mysqltem.
  • Click "OK" to proceed
  • The setup program loads and guides you through the installation process.
  • Choose the "Custom" installation.
  • Change the installation directory to C:\MySQL\MySQL Server 5.1\
  • Change the datafiles directory to C:\MySQL\ will place all DB files in C:\MySQL\Data\
  • Once the installation is complete, allow the launch of the configuration
    • Choose Detailed Configuration
    • Choose Developer Machine
    • Choose Transactional Database Only
    • Choose (DSS)/OLAP
    • Use port 3306 Remember to Add firewall exception for this port
    • Add bin directory to Windows Path
  • All developer PC will use:
    • user:root
    • password:sesame
  • MySQL server should be started as a service.
  • Open the mysqlcmd prompt from the program menu.
  • You should see a "mysql" prompt.
  • To test the MySQL server, type "show databases;" at the prompt.
  • This should display something like:

+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| test |
+——————–+
3 rows in set (0.06 sec)

If you see the above… congrats… you have sucessfully installed MySQL on your system.

  • To exit type "quit" at the mysql prompt.
Additional tools for MySQL should be installed from here: MySQL-downloads

Uninstall Previous Version of MySQL

This will also answer the question 'How to uninstall MySQL as a service'.

To remove the service, stop the service or goto a DOS box and type 'mysqladmin -uroot -p shutdown' , type your master password if it asks for it. Type in 'mysqld –remove' and this will uninstall and remove the service.

If you want to save your exisiting databases then goto 'C:\mysql\data\' and copy all the sub-folders in there that you want to keep, and paste them into a temporary location. Once your new installation is up and running, you can copy them back into 'C:\mysql\data\' ready for use. Note that this is not exactly the same as the 'upgrade MySQL' method on the mysql website, but works for me.

Whether you have saved your old databases or not, the next step in removing MySQL is then to delete the folder 'C:\mysql\' and all its containing sub-folders.

You are now safe to proceed to install your new version.