Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a bit of a follow up to one of my previous questions regarding how to install mysql on windows server 2008.

I managed to install the mysql server etc. without any problems, it runs, I can connect to it via PHP using "." as host (strange, but ok).

In order to follow best practices and not let mysql running with too much privilegs, I tried to assign the mysql service a special user.

So here is what I did:

Run this command to create a user:

net user mysql * /add /passwordreq:yes /passwordchg:no /comment:"runs MySQL services" (entering password information)

Run services.msc

Find mysql service in the list, and assign it the "mysql" user I created (in the "Logon" tab).

Windows tells me that changes are done, but the service must be restarted.

I restart mysql service and here comes the error - windows tells me that mysql service could not be started because it exited unexpected.

When I do not assign mysql a user, it works. Did I miss something?

share|improve this question
up vote 1 down vote accepted

If you are still using the database files from when you had the database running as Administrator, you will need to give ownership of the database directory (and below) to the newly created user.

share|improve this answer

Have you assigned appropriate rights for yor mysql user, e.g. "Log on as a service", "Log on as batch job", "Act as part of OS", "Bypass traverse checking", "Adjust memory quotas for process", may be "Lock pages in memory", and so on?

share|improve this answer
Hm, no actually not, that of course could be the problem. Where can I do this after I created such a user per command line? – Max Oct 11 '09 at 7:30
And what would be the best settings in this case for the mysql user? – Max Oct 11 '09 at 7:31
I'm not sure it can be done using command line - may be using PowerShell... I've confuguring it with gpedit.msc usually. But this for starting MS SQL Server with specified user accounts - I never trying it with MySQL... I have an other idea. Check your mysql special user access rights for MySQL installation and data folders (my.ini file also if it located in some other place). You can assing "Full Access" right for specified user from command line using icacls utility: icacls %your path% /grant "%user%:(F)" – Sergey Oct 11 '09 at 11:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.