I’m just starting with CodeIgniter and followed the tutorial to get used to it. When it came to the database connection I ran into a problem.
The application I want to develop has to deal with an existing MySQL database that’s accessible over the internet. My current development webserver runs locally. I set the correct connection parameters in the config/database.php and tried to connect to that database, which didn’t work. I get this error: “Unable to connect to your database server using the provided settings.”
So I carefully tried the very same username, password, host & db name with other clients: with command line mysql I can instantly connect flawlessly, same with gui clients like HeidiSQL. Everything works as expected. Btw: the hostname resolves correctly, I also tried the plain ip address, same behaviour.
I put back these obviously correct settings back into database.php and I get the same error mentioned before.
To make things a little more strange: I installed MySQL locally and tried to connect to that db with CodeIgniter - and it worked.
I have to access the database on the internet as all the relevant data is in there, so a workaround with a local db renders the whole project useless.
I greatly appreciate your help, thanks in advance!