Error: MySQL said: Access denied for user ‘root’@’localhost’ in MySQL 5.7

Hello everyone!

If you are trying to install new MySQL instance and want to connect to this instance through SSH tunnel with GUI software like Sequel Pro or MySQL Workbench then you can’t help meeting with the error: MySQL said: Access denied for user ‘root’@’localhost’ . Especially if you are installing a Percona MySQL Server.

It occurs because MySQL resolves address localhost as and by default in mysql.user table exits a record for localhost users only. But in case if you create a new user for and try to connect through SSH you can get the same error. You can solve these errors with simple action, just put this single line in your my.cnf in [mysqld] section:

skip-name-resolve = 1