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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s