Rechercher : dans
Par :

Acces securisé au champ d'une table Mysql

Dernière réponse le 4 oct 2004 à 14:00:55 nicolas, le 4 oct 2004 à 12:39:11 
 Signaler ce message aux modérateurs

Salut a tous,

Je debute sous Mysql ... je cherche a faire 2 tables contenants divers champs.
Certain utlisateur auraont acces a tout les champs de la table et d'autres utilisateurs a certains champs ..
Comment faire pour gérer ca ????
Merci et bon appétit,

nicolas

Meilleures réponses pour « acces securisé au champ d'une table Mysql » dans :
MySQL - Supprimer des doublons dans une table VoirPour supprimer des doublons au niveau d'une table donnée définie comme suit : CREATE TABLE IF NOT EXISTS TabTest ( cle_prim integer(4) NOT NULL auto_increment, x integer, y integer, z integer, ...

1

jisisv, le 4 oct 2004 à 13:33:42

Essaye de restructurer ta base de données de sorte que les utilisateurs
(toto et titi) n'accède qu'aux tables dont ils ont besoin pour leur requêtes.

 mysqladmin -u root create bidon
mysql -u root bidon
mysql> create table tabletiti (f1 char(10));
mysql> create table tabletoto (f2 char(10));
mysql> grant all privileges on bidon.tabletoto to toto@localhost identified by 'toto';
mysql>grant all privileges on bidon.tabletiti to titi@localhost identified by 'titi';

Alors
johand@horus:~$ mysql -u toto -ptoto bidon
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 16 to server version: 4.0.21-log

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

mysql> select * from tabletiti;
ERROR 1142: select command denied to user: 'toto@localhost' for table 'tabletiti'

Johan
Il faudra évidemment disposer d'un utilisateur ayant le droit de lier les tables sinon , on perd l'utilité d'une BDD relationnelle.
Gates gave you the windows.
GNU gave us the whole house.(Alexandrin)

Répondre à jisisv

2

 nicolas, le 4 oct 2004 à 14:00:55

Merci mille fois ;-)
nicolas

Répondre à nicolas