Spaces, unfortunately, can be part of a MySQL server username.
It is very counter-intuitive, it is extremely rare, but since I got one report about someone not being able to connect to such a server with this kind of a username I have a user on my local MySQL server with the username space
(since you can't really see it unless you view the source of the HTML reply, it is space followed by a space character). Yes, you can use it just fine to log into the MySQL server. It's maddening, but it's real.
Since leading and trailing spaces are legitimate username characters I am unfortunately unable to trim the username provided as it would break legitimate connections with this kind of uncommon username.
I wish I was making this up. My life would be far simpler if I could just yeet invisible leading and trailing characters from username fields. As you have intuited, it's not an uncommon problem.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!