Nico Amarilla

My personal notes on programming.

How to Manually Install MySQL on Windows

MySQL is one of the world’s most widely used open-source relational database management system. It is a popular choice of database for use in web applications and is the M in WAMP stacks. WAMP stands for Windows, Apache, MySQL, PHP. This tutorial is on how to manually install MySQL on Windows 7.

Installation

  1. Go to dev.mysql.com/downloads/.
  2. Choose MySQL Community Server for Windows.
  3. Download the Windows (x86, 32-bit), ZIP Archive.
  4. Once the download has completed, extract the contents of the ZIP and rename the folder “mysql-5.6.19-win32″ to “mysql”.
  5. Move the “mysql” folder to D:\webserver\.
    mysql1

Note: MySQL 5.6.19 was the latest at the time of this writing.

Configure MySQL

  1. Inside D:\webserver\mysql find and rename the file my-default.ini to my.ini. This is the MySQL configuration file.
  2. Open my.ini and find:
    [mysqld]
  3. Under it find:
    # basedir = .....
    # datadir = .....
  4. And replace with:
    # points to installation directory
    basedir="D:/webserver/mysql/"
    # points data directory
    datadir="D:/webserver/mysql/data/"

    mysql2

  5. Save my.ini.

Install MySQL as Windows Service

  1. Open cmd and run it as administrator and go to drive D by typing:
    D:

    Hit enter to run the command.

  2. Go to the MySQL bin folder by typing the command below and hitting enter:
    cd webserver/mysql/bin
  3. Test mysql if it will run by typing the command below and hitting enter:
    mysqld

Note: If a firewall prompt appears, click allow.

  1. To shutdown mysql, open another command prompt and type this command:
    mysqladmin.exe -u root shutdown
  2. Now that mysql can run, install it as a windows service by typing this command:
    mysqld --install

MySQL should now be installed and will run everytime Window starts.

Uninstall MySQL Windows Service

  1. Stop the running service either via the service console or via task manager in windows 8.
  2. Open cmd and run it as administrator and go to drive D by entering:
    D:
  3. Go to the MySQL bin folder by typing the command below and hitting enter:
    cd webserver/mysql/bin
  4. Delete it by typing the command below and hitting enter:
    sc delete MySQL

    where “MySQL” is the name of the service.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *