Mads Lie Jensen <mads@gartneriet.dk> wrote:
> Du skal lige være opmærksom på at iflg.
>
http://www.mysql.com/doc/en/Default_privileges.html
>
> så har alle brugere som standard ret til at tilgå databaser hvis navn
> starter med 'test' eller 'test_'. Også selv om de ikke er blevet
> oprettet som mySQL-brugere.
Det er nu ikke helt hvad jeg læser:
An anonymous user is created that can do anything with databases that
have a name of 'test' or starting with 'test_' . Connections must be
made from the local host. This means any local user can connect without
a password and be treated as the anonymous user.
Startes mysql uden angivense af bruger [--user=xxxx] så bruges som
default UNIX-brugeren:
[G4
] per% su postgres
Password:
su: Sorry
[G4
] per% su jens
Password:
[G4:/Users/per] jens% cd
[G4
] jens% whoami
jens
[G4
] jens% mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12 to server version: 3.23.54
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use testDB
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> \s
--------------
mysql Ver 11.18 Distrib 3.23.54, for apple-darwin6.3 (powerpc)
Connection id: 12
Current database: testDB
Current user: per@localhost
Current pager: stdout
Using outfile: ''
Server version: 3.23.54
Protocol version: 10
Connection: Localhost via UNIX socket
Client characterset: latin1
Server characterset: latin1
UNIX socket: /tmp/mysql.sock
Uptime: 2 days 1 hour 36 min 40 sec
Threads: 1 Questions: 42 Slow queries: 0 Opens: 18 Flush tables: 1
Open tables: 2 Queries per second avg: 0.000
--------------
===============
Åbenbart ikke alligevel?
===============
mysql> \q
Bye
[G4
] jens% mysql --user=jens
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13 to server version: 3.23.54
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use testDB
ERROR 1044: Access denied for user: '@localhost' to database 'testDB'
mysql> \s
--------------
mysql Ver 11.18 Distrib 3.23.54, for apple-darwin6.3 (powerpc)
Connection id: 13
Current database:
Current user: jens@localhost
Current pager: stdout
Using outfile: ''
Server version: 3.23.54
Protocol version: 10
Connection: Localhost via UNIX socket
Client characterset: latin1
Server characterset: latin1
UNIX socket: /tmp/mysql.sock
Uptime: 2 days 1 hour 37 min 40 sec
Threads: 1 Questions: 45 Slow queries: 0 Opens: 18 Flush tables: 1
Open tables: 2 Queries per second avg: 0.000
--------------
mysql>
===============
Det passer jo ikke helt med hvad du skrev?
--
Cand.scient. Per Erik Rønne
Frederikssundsvej 308B, 3. tv.
DK-2700 Brønshøj
Tlf + fax 38 89 00 16, mobil 28 23 09 92