# Remote connection work but often get error HY000/2002 connection timed out

Hi all,

I have create a remote connection between two linux server running mariadb.\
One run centos stream 9 with 10.5.16-MariaDB and the second run centos 7 with 5.5.68-MariaDB.\
Through php script automated with cron I run queries and it work.

The problem is that often i get the error HY000/2002 connection timed out.\
The error occurs at random times either using cron or launching it manually.\
For example, the script work for 10 times and on the 11th time I receive the error (HY000/2002 connection timed out) which can occur one or more times consecutively and then return to work on the umpteenth execution.\
The number of times the script works or not is always different.

I can't find the cause of the error.\
Any suggestions?

Thanks

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/general-resources/community/community/faq/developer-questions/remote-connection-work-but-often-get-error-hy0002002-connection-timed-out.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
