Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've imported my old database (via phpMyAdmin) and everything seemed to be fine - except for the user/password combinations. I tried to do a "FLUSH PRIVILEGES" and afterwards, I couldn't login anymore into my root account either (which was working).

I tried to reset it via stopping the mysqld, starting mysqld_safe with the --skip-grant-tables flag and reset the root password. It returned no error message, but when I tried to login I still got 'Access denied'.

Any idea of what might have gone wrong?

Thanks a lot!

PS: This is on a Debian 5.0.6 System


EDIT: Somehow my root account was gone. I had to repeat the steps again, reset all the other passwords in the mysql.user table and add a new root account via

mysql> INSERT INTO user VALUES ('localhost','root',password('newpass'),'Y','Y ','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y', 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','' ,'','','',0,0,0,0);
mysql> INSERT INTO user VALUES ('127.0.0.1','root',password('newpass'),'Y','Y ','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y', 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','' ,'','','',0,0,0,0);

Now it's working again.

Thanks for all the replies! Cheers

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

just stop mysql [use kill if needed] and run it for a second with --skip-grant-tables option, change password for both root and debian-sys-maint password [so it matches one in /etc/mysql/debian.cnf ]

share|improve this answer
add comment

I don't know whether it does anything other than run mysqld_safe etc but I ran

dpkg-reconfigure mysql-server-5.0

and it gave me the option to reset the root password.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.