kako ograniciti jednog user-a da ima pristup samo jednoj bazi podataka a da drugima ne moze pristupiti pa cak ni vidjeti ostale baze koje su na serveru?
Ograniciti user-a na jednu bazu
Zaključano
Zakačeno
dodelis mu privilegije samo za tu bazu ...
na primer:
na primer:
Code:
[arhimed@gedora10 6.3.21]$ bin/mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.31-ndb-6.3.21-innodb-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| d1 |
| d2 |
| database2 |
| mysql |
| sbtest |
+--------------------+
6 rows in set (0.00 sec)
mysql> grant all privileges on d2.* to 'luzer'@'localhost' identified by 'pera';
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[arhimed@gedora10 6.3.21]$ mysql -uluzer -ppera
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.31-ndb-6.3.21-innodb-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| d2 |
+--------------------+
2 rows in set (0.00 sec)
mysql>
[arhimed@gedora10 6.3.21]$ bin/mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.31-ndb-6.3.21-innodb-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| d1 |
| d2 |
| database2 |
| mysql |
| sbtest |
+--------------------+
6 rows in set (0.00 sec)
mysql> grant all privileges on d2.* to 'luzer'@'localhost' identified by 'pera';
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[arhimed@gedora10 6.3.21]$ mysql -uluzer -ppera
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.31-ndb-6.3.21-innodb-log Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| d2 |
+--------------------+
2 rows in set (0.00 sec)
mysql>
Potpis
hvala puno na brzom odgovoru.
to je to sto trazim! :)
to je to sto trazim! :)