Reputation: 468
Is it bad practice to use dots in a username for Mysql? And more important, why? What can go wrong? For example: john.doe
Upvotes: 0
Views: 1231
Reputation: 116110
A good (?) reason would be that it's impractical to have user names with dots, because it's not a valid identifier. That means you have to enclose it in backticks (``
) in statements like create user
, grant
, set password
, and probably others.
In itself it's not a big issue, and it's certainly allowed to use various special characters, as long as you are aware that you may need those backticks.
Same argument goes for spaces and other special characters in table names and column names, of course. My personal preference would be to not do that, but that's just an opinion. You have to decide that for yourself.
Upvotes: 2