List:MySQL on Win32« Previous MessageNext Message »
From:Jonathan G. Lampe Date:August 4 2004 2:00pm
Subject:Re: User privileges on MySQL
View as plain text  
At 03:35 AM 8/4/2004, S.D.Price wrote:

>1. I know I should set a password for the root account but I seem to
>have two root accounts. One with access to all hosts % and one with
>access to localhost. Which one should I set a password on,

Both.  And if your machine is on a network, you should have done it 
yesterday.

>and what is
>the difference between them?

Many people use MySQL from their local machine only, so their first act is 
often to simply delete the "%" (all hosts) entry.

>2. Is the best way to set a password on the root to cd:\mysql\bin and
>then go mysqladmin -u root password 'thepassword'

I believe that will set the LOCAL password.
I believe you need to do:
mysqladmin --host=(myIP) -u root password 'thepassword'
...to set the ALL HOSTS password.

>3. When I created an account with all privileges on all databases I
>could not connect to a database with a username or password. I had to
>use blank strings instead. Is this because I had 2 user accounts called
>ANY (again one with access to all hosts % and one with access to
>localhost).

Probably - use the "mysql" console utilty and play around with different 
values (i.e. "localhost", your IP address, your hostname) in the "--host=" 
argument to see how MySQL behaves in the various situations.

>4. Please tell me how I should ideally set up my user permissions

It depends on what you want to do.  Is this an ISP MySQL where lots of 
people need access, a distributed application database server where only a 
few hosts need access or a local application?  If you need remote access, 
can you limit your users to only a few classes of permissions (e.g. Read)?

-jgl 

Thread
User privileges on MySQLS.D.Price4 Aug
  • Re: User privileges on MySQLJonathan G. Lampe4 Aug
RE: User privileges on MySQLS.D.Price4 Aug
  • RE: User privileges on MySQLArmando4 Aug