By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

Strange looking mysql.user table

P: n/a
My MySQL.user table (user, host, password) looks like the following:

+---------+-----------+---------------------+
| user | host | password |
+---------+-----------+---------------------+
| root | localhost | |
| root | % | |
| | localhost | 3823a5ee1f831626 |
| | % | |
| jim | % | 426d920b373a5e5b |
+---------+-----------+---------------------+

This looks strange to me.
1) two entries for root
2) two blank entries.
3) is jim's host correct?

This is on a private, standalone system for MySQL/PHP learning purposes.

If this is strange, should I remove any of these entries using SQL "Delete
From"

Thank you...

Bruce
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I noticed that Message-ID: <40********@news1.prserv.net> from Bruce A.
Julseth contained the following:

If this is strange, should I remove any of these entries using SQL "Delete
From"


Nothing strange about it if it is a single table with no primary key.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #2

P: n/a
Bruce A. Julseth wrote:
My MySQL.user table (user, host, password) looks like the following:

+---------+-----------+---------------------+
| user | host | password |
+---------+-----------+---------------------+
| root | localhost | |
| root | % | |
| | localhost | 3823a5ee1f831626 |
| | % | |
| jim | % | 426d920b373a5e5b |
+---------+-----------+---------------------+

This looks strange to me.
1) two entries for root
2) two blank entries.
3) is jim's host correct?

This is on a private, standalone system for MySQL/PHP learning purposes.

If this is strange, should I remove any of these entries using SQL "Delete
From"

Thank you...

Bruce


the "%"-sign says to allow a user named root to access the database from
any host. Jim and "" can also access it from any host with a MySQL
client.

<nobody> on local host can access it with or without a password. I
would probably remove both of these entries for security purposes and
you really can't have a '' username.

to see if the name is actually '' or if it contains spaces you can do
something like:

select length(user),user,host from user;

then
delete from user where user='' and (host = "%" or host = 'localhost');
and insert the proper number of spaces.

Michael Austin.
Jul 17 '05 #3

P: n/a

"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:OB******************@newssvr24.news.prodigy.c om...
Bruce A. Julseth wrote:
My MySQL.user table (user, host, password) looks like the following:

+---------+-----------+---------------------+
| user | host | password |
+---------+-----------+---------------------+
| root | localhost | |
| root | % | |
| | localhost | 3823a5ee1f831626 |
| | % | |
| jim | % | 426d920b373a5e5b |
+---------+-----------+---------------------+

This looks strange to me.
1) two entries for root
2) two blank entries.
3) is jim's host correct?

This is on a private, standalone system for MySQL/PHP learning purposes.

If this is strange, should I remove any of these entries using SQL "Delete From"

Thank you...

Bruce
the "%"-sign says to allow a user named root to access the database from
any host. Jim and "" can also access it from any host with a MySQL
client.

<nobody> on local host can access it with or without a password. I
would probably remove both of these entries for security purposes and
you really can't have a '' username.


So, I should remove the entries that have no user name. If I can't have a ''
user name, where is anonymous in my table? What does anonymous look like?

to see if the name is actually '' or if it contains spaces you can do
something like:

select length(user),user,host from user;

then
delete from user where user='' and (host = "%" or host = 'localhost');
and insert the proper number of spaces.
These user names were truly blank. I already did a select to see if I could
find them so your delete statement will work with ''.

Thanks for the help..

Michael Austin.

Jul 17 '05 #4

P: n/a
Bruce A. Julseth wrote:
"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:OB******************@newssvr24.news.prodigy.c om...
Bruce A. Julseth wrote:

My MySQL.user table (user, host, password) looks like the following:

+---------+-----------+---------------------+
| user | host | password |
+---------+-----------+---------------------+
| root | localhost | |
| root | % | |
| | localhost | 3823a5ee1f831626 |
| | % | |
| jim | % | 426d920b373a5e5b |
+---------+-----------+---------------------+

This looks strange to me.
1) two entries for root
2) two blank entries.
3) is jim's host correct?

This is on a private, standalone system for MySQL/PHP learning purposes.

If this is strange, should I remove any of these entries using SQL
"Delete
From"

Thank you...

Bruce


the "%"-sign says to allow a user named root to access the database from
any host. Jim and "" can also access it from any host with a MySQL
client.

<nobody> on local host can access it with or without a password. I
would probably remove both of these entries for security purposes and
you really can't have a '' username.

So, I should remove the entries that have no user name. If I can't have a ''
user name, where is anonymous in my table? What does anonymous look like?


user = "%" and host = "%" !! very dangerous I might add...
says anyone can connect without a password from any host.

user = "%" and host = "localhost" !! safer. all users on localhost
any user on "this" host can connect.

<snip>

Michael Austin.

Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.