I just installed MySQL on Debian 6.
With PHPMyAdmin I noticed there are already 4 MySQL users:
debian-sys-maint (localhost) root (127.0.0.1) root (localhost) root (myhostingcompanyurl)
Are all of those necessary?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
The answer is "sort of". The debian-sys-maint one is definitely necessary, Debian uses it to perform automatic maintenance like rotating logs.
The three different root accounts are because MySQL treats your host address as part of your account, so even with the same username, you might get a different account depending on how you connect.
'root'@'localhost' is an account using "root" as their username who connects to MySQL via the socket file (eg /var/run/mysqld/mysqld.sock).
'root'@'127.0.0.1' is an account using "root" as their username who connects via TCP/IP coming from the 127.0.0.1 IP address.
'root'@'myhostingcompanyurl' is an account using "root" as their username who connects via TCP/IP coming from an IP address that reverse-resolves to
If you don't want to have different permissions for people calling themselves root depending on how they connect to the server, you could create a
'root'@'%' account, where % will match any connection's hostname, keeping in mind that you lose security in the case that 'root'@'someforeigncountry' figures out how to connect. Then you could remove the three specific accounts.