When connecting to MySQL, I get an "Unknown Host" error.

ERROR 2005 (HY000): Unknown MySQL server host 'myqsl--do-user-example-0.db.ondigitalocean.com' (0)

An Unknown Host error occurs when:

  • You use the wrong DNS hostname.
  • There are underlying problems with DNS resolution.

If you are getting this error:

  • Verify that your hostname is correct.
  • Verify whether the machine you’re connecting from has problems with DNS resolution.
Ensure your queries are not timing out and check your network connection.
Verify your login credentials and user permissions.
Verify that the hostname is correct and that you’ve created the database.