Unauthenticated User in MySQL ?

Yesterday I have seen in MySQL processlist some unauthenticated user was showing. I was wondering what is this ? So I did some research and found out some interesting thing about MySQL config.

Apparently what happened that a connection with “unauthenticated user” in the User column has initiated a connection but hasn’t sent his credentials yet, so the server doesn’t know who exactly is connecting.

If such connections only showed up in the list when they were authenticated, it could potentially run the server out of available sockets and you wouldn’t even know why.

At most of the times, such connections get stuck because of DNS Resolve not happening accordingly or it’s taking so much time.

Actually by default MySQL checks for user hostnames using DNS check. Now there are some scenarios

You never know when you hosting provider DNS goes down and MySQL will silently stop letting users in. Most worst thing is that you don’t even find out what the problem is while diagnosing the issue ?

Another scenerio which many happen that DNS goes slow, now because of all this connections will get slow as well eventually.

Also another problem is that if your servers are externally available than anybody can do DDOS attacks on your MySQL instance very easily.

So if you don’t need to restrict MySQL users based on hostnames than disable this feature of MySQL’s authentication system by adding “skip_name_resolve” in my.cnf config file of MySQL.

Originally published at nilesh1013.github.io.

Like what you read? Give Nilesh Sharma a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.