Thank you Lucas.
But why I have to put localhost at the end? The manual says that I can put a wild card "%", like iz3@"%". Or if I did not put anything, it will automatically assume localhost.


Thanks again.

Ian Zhang

[EMAIL PROTECTED] wrote:

Try this:

GRANT ALL PRIVILEGES ON izdb.* TO iz2@'localhost' IDENTIFIED BY 'iz';



Lucas Cowgar
Information Technologies Department
Eldorado Services Group Inc.
http://www.eldoserv.com
[EMAIL PROTECTED]
(330) 861-3009

"All your base are belong to us"

----- Original Message -----
From: "ianhzhang" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 24, 2003 1:37 PM
Subject: Question for the GRANT statement




Hi,

I am new to MySQL and SQL in genreal.  I just installed mysql 3.23.55 on
my Red Hat Linux 7.1.

I tried to GRANT user in the following way:
CREATE DATABASE izdb;
GRANT ALL ON izdb.* TO iz1 IDENTIFIED BY 'iz';
GRANT ALL ON izdb.* TO [EMAIL PROTECTED] IDENTIFIED BY 'iz';
GRANT ALL ON izdb.* TO iz3@"%" IDENTIFIED BY 'iz';
FLUSH PRIVILEGES;


It seems to me that I can only login using iz2.


The output as follows:
[EMAIL PROTECTED] mysql]$ bin/mysql -u iz1 -p'iz'
ERROR 1045: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)
------------------------------------------------------------------
[EMAIL PROTECTED] mysql]$ bin/mysql -u iz2 -p'iz'
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 3.23.55-max

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> quit
Bye
--------------------------------------------------------------------
[EMAIL PROTECTED] mysql]$ bin/mysql -u iz3 -p'iz'
ERROR 1045: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)

------------------------------------------------------------------
Can anyone tell me what I did wrong with iz1 and iz3?  I thought iz1 and
iz2 should be the same and iz3 should be on any hosts.


By the way, I print out all my SHOW GRANTS command output:


Thank you.

Ian Zhang





mysql> SHOW GRANTS FOR iz1;



+---------------------------------------------------------------------------
+


| Grants for [EMAIL PROTECTED] |



+---------------------------------------------------------------------------
+


| GRANT USAGE ON *.* TO 'iz1'@'%' IDENTIFIED BY PASSWORD
'077deb434925b35d' |
| GRANT ALL PRIVILEGES ON `izdb`.* TO 'iz1'@'%'     |



+---------------------------------------------------------------------------
+


2 rows in set (0.00 sec)

mysql> SHOW GRANTS FOR iz2;
ERROR 1141: There is no such grant defined for umysql> SHOW GRANTS FOR


iz3;


+---------------------------------------------------------------------------
+


| Grants for [EMAIL PROTECTED] |



+---------------------------------------------------------------------------
+


| GRANT USAGE ON *.* TO 'iz3'@'%' IDENTIFIED BY PASSWORD
'077deb434925b35d' |
| GRANT ALL PRIVILEGES ON `izdb`.* TO 'iz3'@'%'     |



+---------------------------------------------------------------------------
+


2 rows in set (0.00 sec)

mysql> SHOW GRANTS FOR [EMAIL PROTECTED];
ERROR 1141: There is no such grant defined for user 'iz3' on host
'localhost'
ser 'iz2' on host '%'
mysql> SHOW GRANTS FOR [EMAIL PROTECTED];



+---------------------------------------------------------------------------
--------+


| Grants for [EMAIL PROTECTED] |



+---------------------------------------------------------------------------
--------+


| GRANT USAGE ON *.* TO 'iz2'@'localhost' IDENTIFIED BY PASSWORD
'077deb434925b35d' |
| GRANT ALL PRIVILEGES ON `izdb`.* TO 'iz2'@'localhost'             |



+---------------------------------------------------------------------------
--------+


2 rows in set (0.00 sec)




--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail


<[EMAIL PROTECTED]>


Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php






---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php






--------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Reply via email to