7

Many web services require a database and quite often that is MySQL. Typically, the installation instruction of the software tells you to create a database and a user with permission for that database.

Is it OK to name the user and the DB the same?

For example, I am installing Openfire right now and I created a MySQL database "openfire" and MySQL user "openfire". Should I expect any problems? What is the convention?

2 Answers 2

11

Yes, that is absolutely fine and quite a common practice. They are mutually exclusive in use and will not cause any problems.

All you need to ensure is that they comply with username and schema naming conventions:

1

It is ok to name the user and the DB the same, you should not have problem.

But from a security point of view you should maybe use another username.

3
  • security by obscurity is not a very good idea
    – ptman
    Feb 17, 2015 at 11:21
  • I voted up to cancel the negative vote, because the answer does not imply that I should employ a security by obscurity method. Sep 14, 2016 at 11:37
  • Ditto, because whilst I agree with ptman generally, changing the admin/default username from a default or easily-guessed value IS standard security practice. And because this does still answer the OP's question.
    – randomsock
    May 22, 2017 at 10:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .