<tlr7425,
Wednesday, July 31, 2002, 10:49:13 AM, you wrote:
t> i've read up and am able to add users with encrypted passwords.
t> what i want to do is restrict a user to a database.
t> in the mysql db there is the users table and the db table. i understand
t> that permissions in the users table override those of the db table.
t> so what i do is this:
t> 1) create a user in the users table with whatever permissions are
t> appropriate (if there's a permission grant in the users table that refers to
t> db restriction, i'm missing it)...
t> 2) in the db table i create the user (same one i just put into the users
t> table.
t> now, when i log in locally as that user (the user can access from anywhere)
t> i can still access other dbs.
t> what am i not doing right?
First of all usage of GRANT to set up privileges is recommended. If you want to set up
privileges for user on a specific database you should simply execute a command:
GRANT <privileges> ON database_name.* TO
'user_name'@'host_name' IDENTIFIED BY 'password';
This command automatically add appropriate rows to the tables 'user' and
'db'.
If you change privilege table manually, you should do
FLUSH PRIVILEGES;
after modification.
--
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Egor Egorov
/ /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED]
/_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php