0

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?

2 Answers 2

1

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.

1

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?

3
  • 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?
    – BMBM
    Oct 11, 2009 at 7:30
  • And what would be the best settings in this case for the mysql user?
    – BMBM
    Oct 11, 2009 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, 2009 at 11:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .