Les Allergies
Alimentaires
Posez votre question Signaler

Acces securisé au champ d'une table Mysql

nicolas - Dernière réponse le 4 oct. 2004 à 14:00
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
Lire la suite 

Acces securisé au champ d'une table Mysql »

2 réponses
Réponse
+0
moins plus
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)
nicolas - 4 oct. 2004 à 14:00
Merci mille fois ;-)
nicolas
Ajouter un commentaire
Ce document intitulé « acces securisé au champ d'une table Mysql » issu de CommentCaMarche (www.commentcamarche.net) est mis à disposition sous les termes de la licence Creative Commons. Vous pouvez copier, modifier des copies de cette page, dans les conditions fixées par la licence, tant que cette note apparaît clairement.
Dossier à la une
Passage au tout numérique : quel coût pour les particuliers ?