---
title: How to Fix the Unknown Host Error When Connecting to MySQL?
url: https://docs.vultr.com/support/products/storage/databases/mysql/how-to-fix-the-unknown-host-error-when-connecting-to-mysql
description: Copy the correct hostname and port from Connection Details to fix MySQL Unknown host errors on Vultr.
publish_date: 2025-09-15T13:59:08.538073Z
last_updated: 2026-10-26T23:33:02.039232Z
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

The following error occurs when the MySQL client cannot resolve the database hostname:

```
ERROR 2005 (HY000): Unknown MySQL server host 'mysql-example.vultrdb.com' (0)
```

This typically happens when the hostname is incorrect or when DNS resolution fails.

Verify that you are using the correct `hostname` and `port` from the [Connection Details](https://docs.vultr.com/products/storage/databases/mysql/management/connection/connection-details) section on your database’s Overview page. Then, connect to MySQL using:

```console
$ mysql --host="<hostname>" --port=<port> --user="<username>" -p
```

If the `hostname` is correct but you still receive the error, check your system’s DNS configuration, ensure you have a working internet connection, and confirm that no firewall or network policy is blocking outbound connections on the specified `port`.
