Root user without permission, even with password set

Asked

Viewed 680 times

-2

My problem is after installing mysql, configuring the password ( I was sure to be root) and installing Workbench. When I try to access the bank, it says:

Your conncetion Attempt failed for user 'root' from your host to server at localhost:3306:

Access denied for user 'root'@localhost'

I’ve seen a way to grant access, but more next, the guy can still enter the password. In my case, it does not pass.

Using the Ubuntu OS 18.04
Mysql 5.7.24-0ubuntu0.18.04.1

Tentativa de acesso

  • I just forgot to ask. Has anyone seen this? ?

2 answers

1

After much crying and patience, I managed to solve my problem.
The bid that exchanged the password setting at the time of installation and for some reason that I do not know, does not appear anymore. You must go after set it up by yourself.
What I did was uninstall everything except Mysql Workbench (it has nothing to do with the problem).
Then I installed everything again, until this command:


sudo mysql_secure_installation

When I typed in the terminal

mysql


He gave

Error 1045...

In this important moment of anger, I decided to put the


sudo mysql

And I got access to Mysql.

Dai, you will have at the terminal the

mysql>

Dai you configure using

use mysql;

Afterward:

UPDATE user SET Password=PASSWORD('AsenhaQUEvoceNAOquerMAISesquecer') WHERE User='root';

FLUSH PRIVILEGES;

and finally:

exit

  • I forgot the links I used to... well, find the answer. https://www.secnet.com.br/blog/alterar-senha-root-mysql-server https://www.digitalocean.com/community/tutorials/howto install-o-mysql-no-ubuntu-18-04-pt

-1

Just to leave registered in case of password loss we can follow the steps below to be able to reset:

  1. Open and edit /etc/my.cnf
  2. Add skip-grant-tables below [mysqld]
  3. Restart Mysql
  4. You should be able to log into mysql now using the command: mysql -u root -p
  5. Execute the command mysql> flush privileges;
  6. Set new password by ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
  7. Go back to /etc/my.cnf and remove or comment skip-grant-tables
  8. Restart Mysql
  9. Now you can login with the new password mysql -u root -p

source: https://stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost

  • Thanks man. The problem I tried this and it didn’t work :'(

Browser other questions tagged

You are not signed in. Login or sign up in order to post.