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"?

asked Dec 11, 2015 at 10:48
4
  • 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? Commented Dec 11, 2015 at 11:04
  • @Phil, they don't have database access. Commented Dec 11, 2015 at 11:08
  • 1
    @ilhan I would still recommend setting up seperate users. It doesn't require much work and can be beneficial Commented Dec 11, 2015 at 11:15
  • It sounds like USE company_db is your level of security. Commented Dec 11, 2015 at 20:13

1 Answer 1

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.

answered Dec 11, 2015 at 11:05
1
  • However, it sounds like there is one application that works for all databases (ie, companies). Commented Dec 11, 2015 at 20:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.