Miguel Cardenas wrote:
Hello list

I have a doubt... Do I need to set a password to a user for each host the user has permission to connect from?

To mysql, a user is '[EMAIL PROTECTED]'. That is, [EMAIL PROTECTED] and [EMAIL PROTECTED] are two different users from mysql's point of view. You may give them the same password and the same privileges, but they are still two different mysql users.

Let's supose

// add user 'somebody'
GRANT ALL PRIVILEGES ON *.* TO somebody@"192.168.0.%" IDENTIFIED BY 'onepass';

if I want 'somebody' to have access from "dsl-A.B.C.D-provider.com" with dynamic address, maybe I should try something like

// add new host
GRANT ALL PRIVILEGES ON *.* TO somebody@"dsl-%-provider.com" IDENTIFIED BY 'onepass';

That should work. See the manual for more <http://dev.mysql.com/doc/mysql/en/connection-access.html>.

   or the right way should be
GRANT ALL PRIVILEGES ON *.* TO somebody@"dsl-%-provider.com";

No.  This creates the user '[EMAIL PROTECTED]' with no password.

When adding a new host, should I provide again the same 'onepass' or the password may/must be different so it changes depending where the user

Each [EMAIL PROTECTED] should have a password, but they need not be different. If [EMAIL PROTECTED] and [EMAIL PROTECTED] are really the same person connecting from two different machines, you may certainly assign the same password and privileges to both.

connects from? if I don't use 'IDENTIFIED BY...' what happens? does mysql
> accept the connection with no password

If the user is new, leaving out the IDENTIFIED BY clause creates a user with no password. Not a good idea. If the user already exists, leaving out the IDENTIFIED BY clause leaves the current password unaltered.

(the user already exists on the system)?

In the situation you describe, the user does not already exist in mysql. New hostname means new user.

I'm not sure, but I guess that in table mysql/user it is possible to have different Host/User/Password entries with a same user and all valid.

Yes.

Thanks for any comment

This is all explained in the manual <http://dev.mysql.com/doc/mysql/en/connection-access.html>.


Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to