1 |
On Monday 13 April 2009, 22:10, Mick wrote: |
2 |
> Hi All, |
3 |
> |
4 |
> I am not sure if I am alarming myself unnecessarily, but this is what |
5 |
> I observed: |
6 |
> |
7 |
> Login as e.g. mick; (this is a unix acccount) |
8 |
> mysql -u root -p |
9 |
> Enter password: XXXXXX |
10 |
> |
11 |
> mysql> GRANT ALTER, CREATE, CREATE TEMPORARY TABLES, CREATE VIEW, |
12 |
> INDEX, INSERT, SELECT, UPDATE ON database1.* TO |
13 |
> 'db_user1'@'localhost' IDENTIFIED BY 'passwd1'; |
14 |
> Query OK, 0 rows affected (0.00 sec) |
15 |
> |
16 |
> mysql> FLUSH PRIVILEGES; |
17 |
> Query OK, 0 rows affected (0.00 sec) |
18 |
> mysql>quit |
19 |
> |
20 |
> Now if I login into database1 as db_user1 and then press the up arrow |
21 |
> key at the mysql> prompt I end up seeing all the previous commands |
22 |
> that I ran as root, including the 'passwd1'!!! |
23 |
|
24 |
Mysql history file is per-(unix)user, so each unix user has his own mysql |
25 |
history file in his home directory. If you login as mysql user db_user1 |
26 |
and see the statements you previously entered as mysql user root, that |
27 |
means you are using the same unix user for both. If there's a security |
28 |
issue, it's that one imho. |
29 |
|
30 |
If you want, you can disable mysql history using one of the techniques |
31 |
described here: |
32 |
|
33 |
http://doc.51windows.net/mysql/?url=/mysql/ch08s06.html |
34 |
|
35 |
see the last paragraph around the middle of the page, just before 8.6.2. |