patternMinor
Is it safe to delete "root" user?
Viewed 0 times
userrootsafedelete
Problem
I have hosted one web application on a staging server where I have deleted "root" users from the database. I don't want to use a common name for superuser. I have also created another admin user(Same as root user).
After this change I have tested my application and did not find any issue. But I reviewed articles where people mentioned that they were getting errors after deleting the root user.
My queries are ,
I am still doing testing on staging server. Once this poc get done , I am planning to delete the root user from the production server as well.
EDIT
This is a new web application which I am going to host on production server and there is no admin script running.
After this change I have tested my application and did not find any issue. But I reviewed articles where people mentioned that they were getting errors after deleting the root user.
My queries are ,
- Is it safe to delete the root database?
- Will it create any issue in future if remove root user?
I am still doing testing on staging server. Once this poc get done , I am planning to delete the root user from the production server as well.
EDIT
This is a new web application which I am going to host on production server and there is no admin script running.
Solution
For administrative purposes, you need to have a
SUPER user WITH GRANT OPTION, but the name ('root') does not matter. But...- Are there any scripts that assume it is
root?
- Such a user should be granted access only from
localhost, thereby adding the OS security on top of that login.
- Do not give
SUPERorWITH GRANT OPTIONto any other user (without understanding the security remifications)
- Each application should have its own login into MySQL. That is, use
root(or your replacement name) only for admin purposes, not for applications.
- Each application login should limit what it can touch. Commonly that is one database, hence
GRANT ... ON dbname. ..., notON .*. (There are exceptions and variations on this rule.)
Context
StackExchange Database Administrators Q#273515, answer score: 4
Revisions (0)
No revisions yet.