PHP 8.0.27 SQL Permission Denied (can connect via other clients)
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

PHP 8.0.27 SQL Permission Denied (can connect via other clients)

by
CameronH
Created on 2023-01-17 14:34:56 (edited on 2024-09-04 14:25:41) in Virtual Private Servers

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.