Low Orbit Flux Logo 2 F

Access denied for user ‘root’@’localhost’ (using password yes) MySQL - EASY Fix

Edit you config file: /etc/mysql/my.cnf

Add the skip-grant-tables option under [mysqld]. It should look something like this:

[mysqld]
skip-grant-tables

Restart the MySQL service:

service mysql restart

Login as root. It shouldn’t require a password anymore.

mysql -u root

Start off by flushing privileges:

mysql> flush privileges;

Set a new password for the root user and flush privileges again:

Password=PASSWORD('my_password') where USER='root';
FLUSH PRIVILEGES;

Remove skip-grant-tables Option

Edit your config file again: /etc/mysql/my.cnf

This time just remove the skip-grant-tables option under [mysqld].

Restart the service:

service mysql restart

You should now be able to login using a password.