0

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
  • @RickJames, I'm trying to improve the security too. It was developed shitty before me, also the manager insists on "choose the shortest way the finish the job" as always, so I leave some points as it is, then some bad thing happens and I tell him why, only then I get permission to improve. Yes, because of this I'm going to leave as soon as possible. – ilhan Dec 13 '15 at 12:39
2

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.

  • 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.