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

David Hummel vox-tech@lists.lugod.org
Mon, 15 Mar 2004 09:45:06 -0800


On Mon, Mar 15, 2004 at 04:58:45AM -0800, Peter Jay Salzman wrote:
> 
> but how does one print all mysql users on a given host?

You need to be the root user, or a user with permission to view the
"mysql" database.

Assuming you have root's password in your ~/.my.cnf:

 # mysql -e "select User from user" mysql

  or

 # mysql mysql
 > select User from user;

> is there something like an /etc/shadoow for mysql?

Yes, the "user" table in database "mysql".

> how does one print the name of all mysql databases on a given host?

 # mysql -e "show databases"

-David