Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Mysql is up and running on my system but i can not login with any user. I also cannot start/stop/status the server. All i got is:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

/usr/bin/mysqladmin: connect to server at 'localhost' failed

error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)

From the logs:

Mar 24 08:30:13 debian /etc/mysql/debian-start[1074]: Upgrading MySQL tables if necessary.
Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: Looking for 'mysql' as: /usr/bin/mysql
Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' '--host=localhost' '--socket=/var/run/mysqld/mysqld.sock' '--host=localhost' '--socket=/var/run/mysqld/mysqld.sock' 
Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: /usr/bin/mysqlcheck: Got error: 1045: Access denied for user 'debian-sys-maint'@'localhost' (using password: YES) when trying to connect
Mar 24 08:30:13 debian /etc/mysql/debian-start[1078]: FATAL ERROR: Upgrade failed
Mar 24 08:30:13 debian /etc/mysql/debian-start[1111]: Checking for insecure root accounts.

I can login after killing the process and start mysql with mysqld --skip-grant-tables but i am not able to reset debian-sys-maint password:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'mypass';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

Update

With UPDATE mysql.user set password=PASSWORD('secret') where user='debian-sys-maint'; i can reset my passwords, but after reboot/restart i have the same problem with this users / mysql again.

How can i reset this password and why does mysql stopped working?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You can start mysql server manually like this:

$ sudo mysqld --skip-grant-tables

Then, you should be able to login without a valid password. To fix the user debian-sys-maint issue, you can get the password from the file /etc/mysql/debian.cnf. Overwrite the current password of this user with the one you find in this file. Also, don't forget to overwrite the root password if you forgot it.

When done, restart mysqld normally.

share|improve this answer
    
Mysql is running again but i am not able to reset a password. mysql> GRANT ALL PRIVILEGES ON . TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'mypass'; ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement –  tonymarschall Mar 28 '12 at 10:24

when running with skip grant, you have to reset the password with something like this:

UPDATE mysql.user set password=PASSWORD('secret') where user='debian-sys-maint';

and not with GRANT.

(i did not test if the syntax is correct. but just do an update on the mysql.user table!)

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.