Setup MySQL on Ubuntu Droplet getting error ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

sudo /etc/init.d/mysql stop
Now start up MySQL in safe mode, so you'll skip the privileges table:
sudo mysqld_safe --skip-grant-tables &
Login with root:
mysql -uroot
And assign the DB that needs to be used:
use mysql;
Now all you have to do is reset your root password of the MySQL user and restart the MySQL service:
update user set password=PASSWORD("YOURPASSWORDHERE") where User='root';
flush privileges;
quit and restart MySQL:
quit
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start
Now your root password should be working with the one you just set, check it with:
mysql -u root -p

Popular posts from this blog

How to install and configure Apache2 for Webhosting on Linux (Ubuntu 14.04)

How to set Java Path if you want to put your java any directory in linux Computer

Make autoservice for Tomcat