LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Duplicate root user in MySQL (http://www.linuxquestions.org/questions/linux-newbie-8/duplicate-root-user-in-mysql-224123/)

buddhahat 08-29-2004 09:39 PM

Duplicate root user in MySQL
 
On my new Slackware 10 install I set up mysql with mysql_install_db.

After starting mysql I logged in as root and entered the following query:

mysql> select host, user from user;

which returned the following results:

+-----------+------+
| host | user |
+-----------+------+
| darkstar | |
| darkstar | root |
| localhost | |
| localhost | root |
+-----------+------+


1) Why are there two root users? Do I need both?

2) What is the empty user for and why is that also duplicated?

Thanks in advance for the help.

linux_terror 08-29-2004 09:53 PM

There are two root users because your system can allow logins from other hosts...

your computer knows itself as darkstar(thats one of my boxes names too lol) and localhost....so in your mysql queries and php configs you can set

$dbhost = localhost

or

$dbhost = darkstar

and your machine will allow/accept the query...
If you are only going to allow access to the db's from your box then it is safe to remove the darkstar user, but it doesn't hurt anything to leave it there.

hope this helps..

linux_terror

linux_terror 08-29-2004 09:56 PM

oh, and the empty user I do believe is the anonymous user which has no permissions...if i am thinking right you do not want to remove that or you will open a potential security hole.

linux_terror

buddhahat 08-29-2004 09:58 PM

Thanks for the reply linux_terror. That makes total sense.

linux_terror 08-29-2004 10:34 PM

no problem :D Glad to help.


All times are GMT -5. The time now is 07:03 PM.