What is the best practice for keeping and maintaining MySQL users? Say for example I have 5 programmers and a PHP application connecting to a database. Should I create 6 different users 1 for each of the users and 1 for the application?

1 Answer 1


Can you please clarify Users vs Programmers? Typically this is how it is done:

1) Create three identical schemas and name them PROD, QA and DEV. Their names are self explanatory.

2) Create a dbuser for the application (PHP) use on each of them. If your app is MYAPP, name the dbuser myapp. This is the login the application uses on behalf of every application user.

3) Create a dbuser called dbadmin on each of them and give it to your DBA.

4) Create a dbuser called myapp_dev on each of them and give it to your developers.

  • I have seen well-organized client at my employer's web hosting company do thi kind of setup over and over again. It makes the most sense to have a sort of chain-of-command when it comes to programmers using PROD/QA/DEV. Some take liberties and make unauthorized changes in DEV and propogates dev changes to QA and PROD all because user administration was not given due attention. This, this answer is a +1 !!! Commented Jul 3, 2012 at 20:52
  • users I mean just the MySQL login username and programmers would be my staff who make changes to the PHP application.
    – Robert
    Commented Jul 5, 2012 at 13:04

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.