Im having issues trying to figure out what is the cause of a failing SQL login. The password seems correct to me, but it still isnt working. I want to see what exactly the user login is sending when attempting to login to MySQL. When i say user login i mean the actual SQL user and not any table.
So for example if i try to login to MySQL with root:wrongpassword. I want to see that wrong password somewhere in a log.
I tried looking through the logs and it looks like sql is writing all of the log information to the log of whatever application is running. For example if php, it shows up in apache, with postfix is shows up in the maillog.
Im getting an error like this, but it is not enough for me to be able to debug what is wrong. I dont know what is being sent.
Connect failed to database (postfix): Access denied for user 'root'@'localhost' (using password: YES)
Fortunately you can't do this, simply because no decent app transfers plaintext passwords over the network nowadays ;) Even if you manage to print the login data somehow what you will see is the hash of the password, not the password itself.
What you can try is sniffing on port 3306 with tcpdump and extract the login from there(provided its not SSL/TLS connection in which case you are out of luck). Again what you will get will not be the plaintext passowrd.
Another possible solution to your problem may be using the mysql proxy and manipulate the login process somehow. For example:
https://github.com/cwarden/mysql-proxy/blob/master/examples/tutorial-scramble.lua