~$ sudo /etc/init.d/mysql restart
* Stopping MySQL database server mysqld [fail]
* Starting MySQL database server mysqld [ OK ]
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
what is this “debian-sys-maint” user?
this MySQL user is created for the Ubuntu to be able to start/stop the database and to carry out other maintenance operations.
Sounds well enough, but then why do I keep running into the “access denied” problem for this user? Well, the issue is that with each update to MySQL, the user’s password in the database is overwritten. Ubuntu seems to go to the file/etc/mysql/debian.cnf in order to find this user’s password, but obviously the password is out of sync after the update has been applied.
Ok, now you must know the version of mysql. (e.g. dpkg list | grep mysql ; it will show you the version)
Sounds well enough, but then why do I keep running into the “access denied” problem for this user? Well, the issue is that with each update to MySQL, the user’s password in the database is overwritten. Ubuntu seems to go to the file/etc/mysql/debian.cnf in order to find this user’s password, but obviously the password is out of sync after the update has been applied.
Ok, now you must know the version of mysql. (e.g. dpkg list | grep mysql ; it will show you the version)
$ sudo dpkg-reconfigure mysql-server-5.1
Thank you for reading this article, please a comment if you are interested.
Tiến Phan - R0039
Knowledge is Endless
Sharing for Success
0 nhận xét:
Post a Comment