4 messages in com.mysql.lists.mysqlRE: Access denied for root user
FromSent OnAttachments
MueR28 Aug 2004 14:44 
Michael Stassen28 Aug 2004 18:35 
MueR29 Aug 2004 08:03 
Michael Stassen29 Aug 2004 10:05 
Subject:RE: Access denied for root user
From:MueR (mu@lunaticsinc.nl)
Date:08/29/2004 08:03:04 AM
List:com.mysql.lists.mysql

From: Michael Stassen [mailto:Mich@verizon.net] Subj: Re: Access denied for root user

MueR wrote:

Hello,

I've recently had my HD crash, and have reinstalled everything. Everything seems to work fine, apart from one thing. My MySQL server has decided to randomly set a root password.

No, it didn't. I know it seems that way, but I'm sure that's not what happened.

I have tried logging in with no password, tried it with my old password. Tried restarting the server with the --skip-grant-tables command, I've tried to update the user table manually.

Everything seems to work out just fine, until the moment I attempt to login using the root account. It will give me the error # 1045 (access denied for user root@localhost).

That's not the full error message, and you've tried a lot of things, so

it's hard to diagnose the problem.

The full error message also includes the using password...

Nothing seems to work. Has anyone ever had this problem? Do you know a solution to it? I am using MySQL v 3.23.49, on a Debian system.

I'd suggest carefully following the directions in the manual <http://dev.mysql.com/doc/mysql/en/Resetting_permissions.html>. If that doesn't work, paste what happens into your next post.

After starting the server with --skip-grant-tables:

utserver1:/var/run/mysqld# mysql -u root Welcome to the MySQL monitor. mysql> UPDATE mysql.user -> SET Password=PASSWORD('xxxxx') -> WHERE User='root'; Query OK, 0 rows affected (0.00 sec) Rows matched: 3 Changed: 0 Warnings: 0`

Or, the other way..

utserver1:/# mysqladmin -u root flush-privileges password "xxxxx" utserver1:/# mysql -u root ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO) utserver1:/# mysql -u root -p Enter password: ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

So none of the two ways described seem to work?