Tuesday, August 09, 2016

Installing MySQL on Windows using a noninstall zip archive

At-least for me, configuring MySQL zip archive on server by reading MySQL team's unfriendly, multi-navigational document has been quite a challenging task.

Here is my simplified version:
  • Download mysql noninstall zip from here: http://dev.mysql.com/downloads/mysql/
  • Extract do C:\mysql folder
  • Under c:\mysql folder you will find my-default.ini file, make a copy of it and rename it to my.ini
  • Open my.ini in notepad, You will find basedir and datadir as commented statements, just uncomment them (by removing # from the starting position of each line) and do the changes shown below
    • basedir = c:\\mysql #installatin directory
    • datadir = c:\\data   #data directory, it can be in some other drive too!
  • Open cmd.exe as admin and type below commands one after the other
    • Go to bin folder where mysqld.exe file is present
      • cd c:\mysql\bin
    • Below command will initialize the data directory, by reading my.ini file (in our case its in c:\mysql folder)
      • mysqld --initialize
    • Install mysql as background running service in Windows.
      • mysqld --install 
    • Verify MySQL server service installation
      • in command prompt just type services.msc and hit enter
      • and look for MySQL service in the services list, set it as "Automatic"
  • That's it!
  • MySQL server will be up and running and can be accessed over 3306 port
  • Download and install the MySQL Workbench and connect to server as root with no password.