Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

i just installed mysql on debian 6.

With phpmyadmin i noticed there are already 4 mysql user:

debian-sys-maint (localhost)
root             (127.0.0.1)
root             (localhost)
root             (myhostingcompanyurl)

are all of those necessarly?

share|improve this question
    
Seems like a dupe of serverfault.com/questions/9948/… –  Arrowmaster Feb 9 '11 at 22:22

1 Answer 1

up vote 1 down vote accepted

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 myhostingcompanyurl.

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.

You can find out more about how accounts are made up of usernames and hostnames in the mysql documentation here, and the "special meaning" of localhost here.

share|improve this answer
    
Also note that even if you use 'root'@'%', you still need a separate 'root'@'localhost' if you want to connect through the socket. –  Brian Feb 10 '11 at 0:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.