skip to Main Content

I have been researching this for close to 4 hours but still, I can’t connect my Invision Community 4 forum to my mysql ran on localhost with xampp.

I can connect from the shell, but I can’t connect to it from elsewhere.

Access denied for user 'root'@'localhost'

2

Answers


  1. I think that remote root access is disabled by default. Run this SQL command via the shell:

    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; FLUSH PRIVILEGES;

    Login or Signup to reply.
  2. Most likely you don’t have the other "IPs" (like localhost) defined.
    Follow these steps to fix it:

    1. Execute this query: SELECT `Host`, `Password` FROM `mysql`.`user` WHERE USER = 'root';
    2. Check results, in this example the pc host has no password:
    Host Password
    localhost *81F5E21E35407D000A6CD4A731AEBFB6AF209E1B
    pc
    127.0.0.1 *81F5E21E35407D000A6CD4A731AEBFB6AF209E1B
    % *81F5E21E35407D000A6CD4A731AEBFB6AF209E1B
    1. Check how are you connected: SELECT CURRENT_USER();:
    CURRENT_USER()
    root@localhost
    1. Now you know how you are connected and if all the user/host pairs share the
      same password or not, and maybe update the one that you want to change.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search