Always read the contents of
/ for packages you have installed. They contain important information for using and administrating packages.
mysql-server-5.5 there are important information in
/usr/share/doc/mysql-server-5.5/README.Debian.gz. As it is
gzipped, it is convenient to use
zmore to read it.
There you can see that you can use the
debian-sys-maint user to access the database for administration. Just as
/etc/mysql/debian.cnf configuration file to login as that user. Notice that you NEVER should change that users password, unless you also change it in the file
debian.cnf. If not, mysql will stop working.
So, to change password for the
root user, try this.
$ sudo mysql --defaults-file=/etc/mysql/debian.cnf
mysql> UPDATE mysql.user SET Password=PASSWORD('*secret*') WHERE User='root';
mysql> FLUSH PRIVILEGES;
$ mysql -u root -p
If you can use the
*secret* password to login in as user
root, you have managed to change the password for
Notice this use of the
debian-sys-maint user only works for Debian based distributions.
Notice also that if you also have the package
dbconfig-common installed and set to store the
root password (see
/etc/dbconfig/config), you need to reconfigure that package so it knows the password to administrat your databases for other packages.
Lastly, good information can also be read in Debians Wiki and in the free The System administrators Book