User Privileges on MySQL 4.1.7
am 30.11.2004 07:09:05 von Osen Kusnadi--=====================_22561481==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed
Hi,
I recently installed version 4.1.7 and I was using 4.0.22 on Windows XP Pro.
I have problem with user permission on MySQL 4.1.7 but it work fine in
MySQL 4.0.22
I was execute query on MySQL 4.0.22 as the follow:
D:\xampp\mysql\bin>mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21 to server version: 4.0.22-nt-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> grant select on test.customers to guest@localhost identified by 'guest';
Query OK, 0 rows affected (0.03 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.06 sec)
Now, log in to mysql with guest as the user.
D:\xampp\mysql\bin>mysql -uguest -p
Enter password: *****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 27 to server version: 4.0.22-nt-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use test;
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| customers |
+----------------+
1 row in set (0.00 sec)
mysql> drop table customers;
ERROR 1142: drop command denied to user: 'guest@localhost' for table
'customers'
Now I use MySQL 4.1.7 as database server, and run the previous query.
mysql> status;
--------------
Connection id: 4
Current database:
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 4.1.7-max
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
TCP port: 3308
Uptime: 5 min 41 sec
Threads: 1 Questions: 15 Slow queries: 0 Opens: 11 Flush tables:
1 Open tables: 0 Queries per second avg: 0.044
--------------
mysql> use test;
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| categories |
| customers |
| employees |
| order details |
| orders |
| products |
| shippers |
| suppliers |
+----------------+
8 rows in set (0.00 sec)
mysql> grant select on test.customers to guest@localhost identified by 'guest';
Query OK, 0 rows affected (0.05 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)
mysql> quit;
Now, log in to mysql 4.1.7 with guest as the user.
mysql> status;
--------------
Connection id: 5
Current database:
Current user: guest@localhost
SSL: Not in use
Using delimiter: ;
Server version: 4.1.7-max
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
TCP port: 3308
Uptime: 7 min 22 sec
Threads: 1 Questions: 25 Slow queries: 0 Opens: 16 Flush tables:
1 Open tables: 0 Queries per second avg: 0.057
--------------
mysql> use test;
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| categories |
| customers |
| employees |
| order details |
| orders |
| products |
| shippers |
| suppliers |
+----------------+
8 rows in set (0.00 sec)
mysql> drop table customers;
Query OK, 0 rows affected (0.01 sec)
On MySQL 4.0.22, user guest just show customers tables only and can't drop
customers table.
But In MySQL 4.1.7, user guest can show all tables on database on can drop
tables too.
O.K
--=====================_22561481==_.ALT--