Closed WizardMuckee closed 1 year ago
Medoo did nothing change for the host value pass to the PDO connection.
You may check out your $dbSettings['DB_SERVER']
value.
Or output the $database->dsn
value to see the final DSN string for the database connection.
Oh yeah my bad... been away from MySQL for a while and was misinterpreting the error.
I had thought it meant I failed authentication whilst connecting to the displayed IP (my local machine), but actually the error was telling me that the displayed IP failed to connect to the server.
Just had to give the user more privileges.
Information
Trying to connect using arguments from env vars. I've checked that the variables contain the correct data.
I want to connect to a remote host but, no matter what I define as the URI, the request is always made to the local IP.
Detail Code
I've changed the actual IP addresses
Expected output I expect an instance of Medoo to be created which connects to the remote address 192.168.0.2, as defined within the DB_SERVER setting.
Actual output
SQLSTATE[HY000] [1045] Access denied for user 'myuname'@'192.168.0.1' (using password: YES)
Where the 192.168.0.1 address is the IP of the local server and it should actually be the value of the 'host' argument I pass to the Medoo constructor, 192.168.0.2.