I am from MSSQL background and trying to learn MYSQL on a windows server 2012 VM. I want to create a user in MYSQL and the user is also a domain account. Please give me the script to get it done or is it a limitation of MYSQL.

CREATE USER 'domain\abc'@'%' IDENTIFIED BY 'password';

If I try the above command then it's creating a user by name 'domainabc' in mysql

1 Answer 1


By default, MySQL server accounts, with the default authentication plugin, are completely unrelated to system or network users. That means that (again, stress on by default), whenever you run: CREATE USER you are creating a mysql-only account, no matter if it has the same name than other system (os) or authentication methods.

However, MySQL has available authentication plugins, which you can enable on a per-account basis, and link it, for example, to OS accounts or LDAP/domain network accounts.

I am personally not familiar with Microsoft Authentication methods (I am myself a Linux administrator, so I only familiar with plugins such as unix_socket and PAM) but a quick search tells me that such plugins indeed exist:


I can even see MySQL installed on Linux servers using PAM to authenticate using windows servers:


If you were unsuccessful with trying those, or don't want to pay for them, you could setup an external utility to sync domain users with MySQL local users.

  • 1
    Although the question is specifically about MySQL, it could be noted that MariaDB, the most relevant MySQL fork, provides pluggable authentication for free, see e.g. the GSSAPI authentication plugin.
    – dbdemon
    Jul 20, 2018 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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