SQLSTATE[HY000] [1045] Access denied for user 'root'@'114.xxx.xxx.xxx' (using password: YES)

1.3k views Asked by At

My connection in env file is like this :

DB_CONNECTION=mysql
DB_HOST=31.220.56.75
DB_PORT=3306
DB_DATABASE=chelsea
DB_USERNAME=root
DB_PASSWORD=terry

When I access my localhost with database server, there is exist error like this :

SQLSTATE[HY000] [1045] Access denied for user 'root'@'114.xxx.xxx.xxx' (using password: YES) 

In database server, I try run this : GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'terry' WITH GRANT OPTION;, there is exist message like this : Query OK, 0 rows affected, 1 warning (0.00 sec)

It looks like it does not work

Is there any people who can help me?

1

There are 1 answers

0
loic.lopez On

Verify in your my.cnf to comment this line

bind-address = 127.0.0.1

and in mysql console

flush privileges;

Finally restart the mysql server.