Error SQL 2002 because my database connection

Hi everyone,

I have a database connection in my kirby project. That connection runs correctly when the database is in localhost as my kirby project. I work with MAMP. Well, In my company We are two people who need to work at the same time so we decided to work with an external database hosted in a server. But the problem is when I try to connect with that external database the kirby project breaks thats the error message:

PDOException thrown with message “SQLSTATE[HY000] [2002] Operation timed out”.

In our hosting we allow “external connection” to our database so We dont know why it doesn’t run. Someone knows whats happend? thank you :slight_smile:

I forgot! If we host the project to a server the database connection with that db runs correctly.

Have you tried to set a longer timeout: https://stackoverflow.com/a/21403360

I havent because the page spend 2 minutes aprox. to load and then returns the error so I think in that time It would run.

I don’t think this is Kirby related. Can you connect to the database via the command line?

Is the external connection IP restricted? Maybe your IP address has changed. Can you connect remotely with SQLPro? Are you sure you are using the correct ports etc?

The problem was that we put bad the data connection values. Thank you for your answers :slight_smile: