MySQL on Ubuntu: Access Denied?

Install MySQL on Ubuntu is very straightforward:

apt-get install mysql-server; apt-get install mysql-client

However, by default there is no way to connect to it using root. debian-sys-maint is the usable super user here. The password for debian-sys-maint is explicitly listed at /etc/mysql/debian.cnf. This means “mysql -u debian-sys-maint -p” with the corresponding passwd is the only access here to mysql server. Next, change the passwd for root by “update user set password=password(‘yourpassword’) where user=’root'”

I did “sudo service mysql stop” and “sudo mysqld –skip-grant-tables” beforehand as well. Not in the mood to check if this step is necessary.