MySQL ErrorLog - [Note] Access denied for user 'root'@'localhost' (using password: YES)

January 24, 2019 1.9k views
MySQL Ubuntu 16.04

Hi! I have a problem with mySQL. Checking the error log, i saw a list of [Note] Access denied for user 'root'@'localhost' (using password: YES) errors for every day.

Can someone tell me why that's happened? How can i know who or what is trying to acceed with root?

(I'm so sorry for my bad english :P )

Thx,
Nicholas

1 comment
  • I am having the same exact issue (ERROR 1045 (28000): Access denied for user 'forge'@'localhost' (using password: YES)). End of the work day yesterday, everything was working accordingly.

1 Answer
ichiparanoid January 24, 2019
Accepted Answer

My english is very bad, but in you console you can create a new user with all privileges. May be your password is wrong:

  • mysql -u root -p -h localhost CREATE USER 'myNewUser'@'localhost' IDENTIFIED BY 'myNewPassword'; *GRANT ALL PRIVILEGES ON *. TO 'myNewUser'@'%'; *FLUSH PRIVILEGES;

Now you can enter whit the user myNewUser.

  • I will try this solution this night. If all goes well i will set the answer as accepted.
    Just a few questions...
    Can this method have security issues?
    Why I need to set it, if I can log-in into phpMyAdmin with an other user?

    • You are giving privileges from any I.P. Maybe changing "TO 'myNewUser'@'%'; "
      for "TO 'myNewUser'@'my.specific.ip';" is better.

      Like this:

      GRANT ALL PRIVILEGES ON . TO 'USERNAME'@'1.2.3.4' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

Have another answer? Share your knowledge.