Forums

Unknown MySQL server host

Hi PA Team,

I have a notification sytem in place which checks for new notifications on a pre-determined interval. I have the application setup to email me of any errors and just received the following: (2005, "Unknown MySQL server host 'xdev.mysql.pythonanywhere-services.com' (0)"). I just checked my application and everything seems to be working fine, but I'm unsure of what I need to do to prevent this from occuring in the first place.

Any ideas on what would have caused this or what I can/should do to prevent this from happening?

Thanks for your help!

I just received this notification too. And my site is showing a server error (500).

That's strange -- where are you seeing those errors? Are they still happening? Can you connect to your databases from the PA Bash console as shown here?

From my error.log:

File "/home/absencelog/.virtualenvs/absencelog/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 179, in init super(Connection, self).init(args, *kwargs2) OperationalError: (2005, "Unknown MySQL server host 'absencelog.mysql.pythonanywhere-services.com' (0)")

This occurred suddenly last night (I haven't changed my code in many months). But this morning it seems to have resolved itself. I can connect to the database through the PA Bash console as well as through Sequel Pro on my local Mac. I don't know what happened last night, but I'm nervous that it will happen again.

Where am I seeing those errors? I've attached the traceback below but it has to do with my django app's sessions.

Are they still happening? After posting the first time, it occured another 5 times yesterday. I haven't seen it happen today.

Can you connect to your databases from the PA Bash console as shown here? Yes, and I verified it was working myself by logging into the site.

<hr />

Traceback (most recent call last): File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/contrib/sessions/backends/base.py", line 233, in _get_session return self._session_cache

During handling of the above exception ('SessionStore' object has no attribute '_session_cache'), another exception occurred: File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection self.connect() File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner return func(*args, **kwargs) File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect self.connection = self.get_new_connection(conn_params) File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/utils/asyncio.py", line 33, in inner return func(*args, **kwargs) File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 234, in get_new_connection connection = Database.connect(**conn_params) File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/MySQLdb/__init__.py", line 123, in Connect return Connection(*args, **kwargs) File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/MySQLdb/connections.py", line 185, in __init__ super().__init__(*args, **kwargs2)

The above exception ((2005, "Unknown MySQL server host 'xdev.mysql.pythonanywhere-services.com' (11)")) was the direct cause of the following exception: File "/home/xDev/.cache/pypoetry/virtualenvs/dropship-UWZJfWmZ-py3.9/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request)

Looks like some network glitch. We will have to investigate.

Great, thank you PA team!

Hello PA Team,

I started receiving a few (2005, "Unknown MySQL server host 'xdev.mysql.pythonanywhere-services.com' (-2)") errors intermittently this morning. The app is still working but I’m unsure if the cause as the app’s code hasn’t changed. Is this related to the tweet you posted earlier?

Are you getting new errors like that (after 6:40 am UTC today)?

Hi pafk, yes the most recent error happend at 2025-10-20 13:56:22 UTC.

Hi pafk, wanted to follow up and let you know the error happend again (timestamps below) since my last post. Any idea on what could be causing this?

  • Mon, 20 Oct 2025 13:03:04 -0700
  • Mon, 20 Oct 2025 12:58:30 -0700
  • Mon, 20 Oct 2025 12:41:24 -0700
  • Mon, 20 Oct 2025 12:38:09 -0700
  • Mon, 20 Oct 2025 12:08:35 -0700

Thanks -- there was a major AWS outage yesterday and that could explain DNS resolution issues, let's keep an eye on this, and if that happens continuously, we'll dig deeper.

Hi PA team,

One of our web apps experienced ran into this issue a few minutes ago (2026-08-14 16:48:37,611) causing the app to crash with a 500 response code. I'm looking through the logs and it seemed to only occur for a brief moment -- are you aware of any issues on your servers, or was this a network glitch?

Yes, we are aware of it. It happened because of some necessary maintenance that we were performing

Thanks, Glenn. I just double checked my email preferences and noticed I am subscribed to everything, but couldn't find a downtime/interuption alert. Was the maintenance "planned"? Helps if I can communicate to clients of downtime in advance (when possible).

No, it wasn't planned as such, we had to scramble to fix things