Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jul 2005 16:45:15 -0500
From:      "Andrew L. Gould" <algould@datawok.com>
To:        freebsd-questions@freebsd.org, Gerard Seibert <gerard-seibert@suscom.net>
Subject:   Re: MySQL - Cannot access as root
Message-ID:  <200507281645.15965.algould@datawok.com>
In-Reply-To: <Pine.WNT.4.63.0507281719350.2756@Treneq>
References:  <Pine.WNT.4.63.0507281719350.2756@Treneq>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 28 July 2005 04:20 pm, Gerard Seibert wrote:
> I have just installed MySQL 5. I can access the program as a regular
> user, but not as root. As I regular user I have no privileges. If I
> attempt to access as root, I receive this error message.
>
> ERROR 1045 (28000) Access denied for user 'root'@'localhost' (using
> password: NO)
>
> I can access the program as root using: mysql -u root -p and then
> supplying a password at the prompt, but that is about it.
>
> What can I do to correct this problem? I tried deleting the entire
> package and reinstalling it, but the problem continues. When I first
> installed the program, it worked, but only one time. Obviously, I did
> something, but I do not know what.

The system root user is separate from MySQL's root user.  The system 
root user should not be able to access the database server directly.  I 
think this is true for both MySQL and PostgreSQL.

If you can log in using 'mysql -u root -p [password]', then everything 
is okay to start.  It's not that you did something wrong, rather you 
haven't finished setting up the database for your user.

Database servers aren't like gui text editors.  It's important that you 
read the documentation.  Here are some helpful links:

Start here for your immediate needs:
http://dev.mysql.com/doc/mysql/en/default-privileges.html

Manual Index:
http://dev.mysql.com/doc/mysql/en/index.html

MySQL Tutorial:
http://dev.mysql.com/doc/mysql/en/tutorial.html

Best of luck,

Andrew Gould



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507281645.15965.algould>