I've locked myself out of my MySQL, because I've forgotten my mysql-root password.
I didn't want to shutdown the MySQL server in order to follow general guides for resetting the password, like this one:
http://www.cyberciti.biz/tips/recover-m ... sword.html
[SOLUTION]
On Debian systems, package scripts sometimes need to initialize database things - so the package system needs a mysql-user with administrator priviledges.
This user is called "debian-sys-maint" - and its password is randomly generated during installation time and can be found in /etc/mysql/debian.cnf
Now, you can use the debian-sys-maint account to log in:
Code: Select all
mysql --user=debian-sys-maint --quick --password
Now within the mysql terminal, type the following to reset the password:
Code: Select all
use mysql;
update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
flush privileges;
quit;
No service restart, no nothing. perfect!