MySQl user admin

Niall Kavanagh niall at kst.com
Tue Jun 13 10:16:53 EDT 2000


As user root:

GRANT ALL ON <database> TO <user> [IDENTIFIED BY <password>]

User would be ptest at localhost. This will give ptest full access, you might
want to restrict ptest to select, insert, update etc. Details in the
manual.

Niall

On Tue, 13 Jun 2000, David Kramer wrote:

> In the past I had a lot of problems getting php to compile with IMAP or
> MySQL support.  After loading PHP 4, I finally got MySQL working (but I
> can't get IMAP working.  Does anyone know when you specify
> --with-imap=DIR what the DIR is supposed to be?  The path to c-client.a
> or the path to rfc822.h?).  Now that I can do something fun with MySQL,
> I just can't get certain things working.
> 
> I create a new database 'ptest'.
> 
> I set up the db record so the user puser can connect to the database
> ptest:
> mysql> select * from db where user='puser';            
> | Host | Db    | User  | Select_priv | Insert_priv | Update_priv |
> Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv |
> Index_priv | Alter_priv |
> | %    | ptest | puser | Y           | Y           | Y           |
> Y           | Y           | Y         | N          | Y               |
> Y          | Y          |
> 
> I set up the user record:
> mysql> select * from user where user='puser';  
> | Host | User  | Password | Select_priv | Insert_priv | Update_priv |
> Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv |
> Process_priv | File_priv | Grant_priv | References_priv | Index_priv |
> Alter_priv |
> | %    | puser |          | Y           | Y           | Y           |
> Y           | Y           | Y         | Y           | Y             |
> Y            | Y         | Y          | Y               | Y          |
> Y          |
> 
> I set up the host record:
> mysql> select * from host where db='ptest';
> | Host | Db    | Select_priv | Insert_priv | Update_priv | Delete_priv |
> Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv |
> Alter_priv |
> | %    | ptest | Y           | Y           | Y           | Y           |
> Y           | Y         | Y          | Y               | Y          |
> Y          |
> 
> ---------------------
> NOW- When I try to log in as puser, it works:
> [root at kramer bin]# mysql --user=puser                          
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 81 to server version: 3.22.32
> 
> Type 'help' for help.
> 
> mysql> 
> --------------
> When I try connecting to that database, no go!
> mysql> use ptest;
> ERROR 1044: Access denied for user: '@localhost' to database 'ptest'
> mysql>
> --------------
> When I try connecting to that database as root, it works, so the db is
> fine.
> [root at kramer bin]# mysql --user=root --database=ptest -p          
> Enter password: 
> Reading table information for completion of table and column names
> You can turn off this feature to get a quicker startup with -A
> 
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 82 to server version: 3.22.32
> 
> Type 'help' for help.
> 
> mysql> 
> 
> Any ideas?  Thanks.
> -
> Subcription/unsubscription/info requests: send e-mail with
> "subscribe", "unsubscribe", or "info" on the first line of the
> message body to discuss-request at blu.org (Subject line is ignored).
> 

--
Niall Kavanagh, niall at kst.com
News, articles, and resources for web professionals and developers:
http://www.kst.com

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list