A Lost Connection
error (ERROR 2013 (HY000)
) occurs when your client cannot maintain a stable connection to your Vultr Managed MySQL cluster while executing a query. This can happen due to:
- Network instability, causing intermittent drops in the TCP connection between your client and the database server.
- Long query execution times, which may exceed MySQL’s
net_read_timeout
or net_write_timeout
values, leading the server to terminate the connection.
- Client-side timeouts, as some MySQL clients or ORMs enforce connection or query timeouts shorter than the server defaults.
You can address Lost Connection
errors by taking the following steps to stabilize your database interactions:
- Ensure your client’s network connection is stable. If connecting from outside Vultr, use the
public hostname
and for resources within the same VPC, use the private hostname
.
- Review and optimize your query to reduce execution time, such as by limiting the number of returned rows or breaking complex operations into smaller queries.
- Increase the client-side timeout or buffer settings where possible, while keeping in mind the default MySQL server
net_read_timeout
is 30 seconds.
- Confirm that your connection parameters (username, password, hostname, port, and database) match those provided in your database’s Connection Details on the Vultr Customer Portal.