[vox-tech] mysql: printing all users and databases

Dave Margolis vox-tech@lists.lugod.org
Mon, 15 Mar 2004 10:15:35 -0800


Peter Jay Salzman wrote:

>thanks tim,
>
>i'll give it a try.  i have to say, i'm a little disheartened with
>mysql.  i just want it to "work" and be secure.
>
>from reading the docs, it _appears_ (although it doesn't say explicitly)
>that not only does each username have a password, each user has a
>password for each hostname.  so 'root'@'localhost' may have a different
>password than 'root'@'someotherhost'.  that's just too bizarre for my
>mind
>
This is true, and admittedly a little strange.  It does offer a choice 
that wouldn't be available otherwise.  What if user@localhost and 
user@someother host ARE different users, or for somebody's idea of 
security practices should have different passwords.  I'd keep them in 
sync, but you never know...

>
>it also looks like a database name of "mysql" may refer to the
>collection of all databases, but i haven't verified that yet.
>
>plus having anonymous users... really, anonymous.  as in, so anonymous
>that they don't even have a username, is a really strange concept.  even
>anonymous ftp users have a username of "anonymous".
>

I don't get what you mean.  I have two mysql users: root@localhost and 
db@localhost.  Root can do everything, and db can select, insert, 
update.  Nobody else can login without the username and the password.  
The annoymous users that come installed by default can be easily 
removed, and they only have access to databased named 'test_*' anyway.

http://www.mysql.com/doc/en/Default_privileges.html

>
>i wanted to set up a slashcode system, but i may just put that off till
>i have more time to sit down and read mysql docs.  the more i learn
>about mysql, the more i'm starting to realize there's no possible
>quickstart...   :(
>

The quickstart is there for sure.  Quickstart with good security and you 
'knowing what's going on under the hood'?  Maybe not, but it really is a 
simple and elegent database system!

>
>i'll give it a few more hours before i put it off as a "major
>undertaking" to be attempted when i have less on my plate than i do
>now.
>
>i'll try your suggestions.  thanks!
>
>pete
>

Good luck,
Dave

>
>
>On Mon 15 Mar 04,  9:01 AM, Tim Riley <timriley@timriley.net> said:
>  
>
>>On Mon, 2004-03-15 at 04:58, Peter Jay Salzman wrote:
>>    
>>
>>>i see how to create new mysql users and new mysql databases, but how
>>>does one print all mysql users on a given host?
>>>      
>>>
>>Did you try "select * from user"? It's just a guess because the book
>>says the table exists, but it doesn't appear in my instance. (Maybe
>>because I've never issued the "grant" command.)
>>
>>    
>>
>>>  is there something like
>>>an /etc/shadoow for mysql?
>>>
>>>how does one print the name of all mysql databases on a given host?
>>>      
>>>
>>"show databases"
>>
>>    
>>
>>>pete
>>>_______________________________________________
>>>vox-tech mailing list
>>>vox-tech@lists.lugod.org
>>>http://lists.lugod.org/mailman/listinfo/vox-tech
>>>      
>>>
>>_______________________________________________
>>vox-tech mailing list
>>vox-tech@lists.lugod.org
>>http://lists.lugod.org/mailman/listinfo/vox-tech
>>    
>>
>
>  
>