1

Web server at 172.168.40.14
Mysql server at 172.168.40.13

There is a user@172.168.40.13 created at 172.168.40.13 MySQL server and it has plenty permissions on database inspeccion

Trying to connect from webserver

$this->pdo = new PDO('mysql:host=172.168.40.13;dbname=inspeccion;charset=utf8', 'user', 'pass');

results in the error:

SQLSTATE[HY000] [1044] Access denied for user 'user'@'172.16.40.14' to database 'inspeccion'

Why in the world is trying to connect to 172.16.40.14 when the code specifycally says conect to 172.16.40.13 ??

Thanks in advace

2 Answers2

2

It is telling you that the 'user' at machine with ip '172.16.40.14' is not able to connect to the database.

It is not actually trying to connect to 172.16.40.14

To grant access to users from any ip or a specific ip, you can have a look at this post grant remote access of MySQL database from any IP address

muasif80
  • 5,586
  • 4
  • 32
  • 45
0

You need to create a user@172.168.40.14 not a user@172.168.40.13 and give all permissions

Leonardo
  • 218
  • 2
  • 7