Hello,
I'm having trouble connecting to my SQL database from my Centos 7 VPS. I have tried using both mysqli and PDO, both are returning permission denied. I have copied the connection string from an identical OVH system and checked everything hundreds of time but I keep getting permission denied. I have managed to connect via phpmyadmin and through TablePlus with no issues, I just can't acccess via php.
The VPS ip is whitelisted and the user account has been granted administrator for all databases. I have also tried using the SFTP account and still, permission denied. If anyone has any pointers on what to check that would be great. Thanks.
Did you try to connect from the same server ?
If yes, in your php config set 127.0.0.1 instead of localhost at Database Host.
If you are try to connect from another server , check the settings to your mysql configuration if it allow remote connections.
Try and tell me please if it works for you.