There is a PHP application that uses only one MySQL username. And there are several databases in the MySQL server. Each database is used by a different company. Should I keep "one MySQL" for the entire system or should I switch to "user per database"? Will I have performance increase if I switch to "user per database"?

  • This should be a security concern, not a performance concern. Do the companies have direct access to the database, or is everything going through APIs/software? – Philᵀᴹ Dec 11 '15 at 11:04
  • @Phil, they don't have database access. – ilhan Dec 11 '15 at 11:08
  • 1
    @ilhan I would still recommend setting up seperate users. It doesn't require much work and can be beneficial – BuahahaXD Dec 11 '15 at 11:15
  • It sounds like USE company_db is your level of security. – Rick James Dec 11 '15 at 20:13

Using different users will not reduce or increase the performance. It is clearly a security issue.

Usually you don't want users from company A to be able to access company B data.

I would recommend to create separate users for each application and grant them only the necessary permissions.

If you run the application using a user with admin rights you risk a lot when the application gets compromised.

| improve this answer | |
  • However, it sounds like there is one application that works for all databases (ie, companies). – Rick James Dec 11 '15 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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