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
- Go to dev.mysql.com/downloads/.
- Choose MySQL Community Server for Windows.
- Download the Windows (x86, 32-bit), ZIP Archive.
- Once the download has completed, extract the contents of the ZIP and rename the folder “mysql-5.6.19-win32″ to “mysql”.
- Move the “mysql” folder to D:\webserver\.
Note: MySQL 5.6.19 was the latest at the time of this writing.
Configure MySQL
- Inside D:\webserver\mysql find and rename the file my-default.ini to my.ini. This is the MySQL configuration file.
- Open my.ini and find:
[mysqld]
- Under it find:
# basedir = ..... # datadir = .....
- And replace with:
# points to installation directory basedir="D:/webserver/mysql/" # points data directory datadir="D:/webserver/mysql/data/"
- Save my.ini.
Install MySQL as Windows Service
- Open cmd and run it as administrator and go to drive D by typing:
D:
Hit enter to run the command.
- Go to the MySQL bin folder by typing the command below and hitting enter:
cd webserver/mysql/bin
- Test mysql if it will run by typing the command below and hitting enter:
mysqld
Note: If a firewall prompt appears, click allow.
- To shutdown mysql, open another command prompt and type this command:
mysqladmin.exe -u root shutdown
- 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
- Stop the running service either via the service console or via task manager in windows 8.
- Open cmd and run it as administrator and go to drive D by entering:
D:
- Go to the MySQL bin folder by typing the command below and hitting enter:
cd webserver/mysql/bin
- Delete it by typing the command below and hitting enter:
sc delete MySQL
where “MySQL” is the name of the service.
No Comments