I edited deian.cnf to change the password of mysql (ubuntu server)

sudo vi /etc/mysql/debian.cnf

I change

user=debian-sys-maint password=*

to

user=debian-sys-maint

password=mypassword

then I tried to enter console of mysql

mysql -udebian-sys-maint -p

and inputed password 'mypassword'

it reported

mysql error 1045(280000) access denied for user 'debian-sys-maint '@' localhost using password 'yes'

I tried to remove mysql and reinstall, the error is same.

Your comment welcome

share|improve this question
    
I think you need to tell mysql about the password change by also changing the password in mysql. – dan08 Aug 7 '13 at 20:46

The error message tell you that, your password is wrong or the account debian-sys-maint has no access to the database on host localhost.

If you are sure your password is correct you should grant all privileges like this:

login as root first

mysql -u root -p <password>

then, grant full permissions:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'your password';

restart mysql and see if the error message is gone.

share|improve this answer

By default root does not have a password and so you need not append -p at the end. simply type

mysql -u root.

To reset the password, use mysqladmin -u root password [newpassword]

share|improve this answer

Most easy way to restoring the debian-sys-maint user, is to reconfigure package mysql-server-5.5. That if you know the password for the root user of MySQL, you can try to restore the user and its password in /etc/mysql/debian.cnf.

sudo dpkg-reconfigure mysql-server-5.5

NOTE: if you cannot stop mysql pid, just run sudo killall mysqld. This is needed for reconfiguring the mysql-server-5.5.

share|improve this answer

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.