MySQL Forums
Forum List  »  MySQL Workbench

Re: MySQL Workbench - Access denied for user @ localhost
Posted by: joseph zangure
Date: January 01, 2020 07:56AM

Hie Wade! I had the same issue and i did the following

The reason is that recent Ubuntu installation (maybe others also),
mysql is using by default the UNIX or auth_socket plugin.


1. set root user to mysql_native_password

$ sudo mysql -u root -p # I had to use "sudo" since is new installation

mysql:~ USE mysql;
SELECT User, Host, plugin FROM mysql.user;
mysql:~ UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql:~ FLUSH PRIVILEGES;
mysql:~ exit;

$ service mysql restart


Or

2. Add new db_user with you system_user(recommended)
$ sudo mysql -u root # I had to use "sudo" since is new installation

mysql:~ USE mysql;
mysql:~ CREATE USER 'YOUR_SYSTEM_USER'@'localhost' IDENTIFIED BY '';
mysql:~ GRANT ALL PRIVILEGES ON * . * TO 'YOUR_SYSTEM_USER'@'localhost';
mysql:~ UPDATE user SET plugin='auth_socket' WHERE User='YOUR_SYSTEM_USER';
mysql:~ FLUSH PRIVILEGES;
mysql:~ exit;

$ service mysql restart

Remember that if you use option #2 you'll have to connect to mysql as your system username (mysql -u YOUR_SYSTEM_USER)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: MySQL Workbench - Access denied for user @ localhost
439
January 01, 2020 07:56AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.