Sunday, October 14, 2012

Installing and running MySQL service on windows

It may occur that while installing a fresh copy of MySQL server, the mysql service does not start automatically. In-fact, service is not added/installed to windows by default. In that case follow the following steps:
I'm assuming that MySQL server is installed. If not then go to MySQL download link and download Windows (x86, 32-bit), MSI Installer

a) First of all change User Account Control (UAC) settings to allow installation of new service to windows. Go to control panel > User Account, then open 'Change User Account Control settings'. Change settings from default to lowest i.e. Never Notify. Hit OK and restart system to apply changes.

b) After restart, open command prompt and navigate to bin directory of MySQL. It might be in ProgramFiles or ProgramFiles(x86). Here is the path of this on my machine: C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin.
$ cd C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin
 then install mysql service using:
$ mysqld --install
Careful - there is 'd' in service name. After installation, you can verify whether service is properly installed or not in services list. (Run services.msc command in run prompt not cmd).

Now just start the service by using (in cmd):
$ net start mysql
That's all. Your MySQL service is up.

No comments:

Post a Comment