Find out the account that the system uses to start and stop MySQL (note that I've changed the password for this demo):
root# cat /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = 11223344554433
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
user = debian-sys-maint
password = 11223344554433
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
Log into MySQL with that account:
root# mysql -u debian-sys-maint -p
Enter password:
mysql>
Change the password:
mysql> update mysql.user set password=PASSWORD("YourNewPassW0RD") where User='root';
mysql> flush privileges; exit;
Log into MySQL as root with your new password:
root# mysql -u root -p
Enter password:
mysql>
The above info is for a Debian GNU/Linux or an Ubuntu setup. If you need to do this on a Red Hat Linux (RHEL), CentOS, or Scientific Linux system, check out this post.



![[image]](http://mowser.com/img?url=http%3A%2F%2Fimg2.blogblog.com%2Fimg%2Fwidgets%2Farrow_dropdown.gif)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fimg1.blogblog.com%2Fimg%2Fwidgets%2Fsubscribe-google.png)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fimg1.blogblog.com%2Fimg%2Fwidgets%2Fsubscribe-netvibes.png)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fimg1.blogblog.com%2Fimg%2Fwidgets%2Fsubscribe-newsgator.png)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fimg1.blogblog.com%2Fimg%2Fwidgets%2Fsubscribe-yahoo.png)