-edit- nevermind, it was the bindaddress. But maybe you can explain why my php apps were able to connect? Or how to make it so i can connect via IP address OR 127.0.0.1. I certainly didnt configure, tell or update the sites to use my ip address instead of 127.0.0.1
I am using MySql on C# running on debian with mono. My app use to work. Then several things happened. I ran out of diskspace, i changed a configuration so ibdata wasnt one big file. My db got full and ran out of disk space again. I also changed my bind-address from 127.0.0.1 to my machine IP address. My app use 127.0.0.1 but i’m unsure what the php sites use. I have a feeling i made other changes (such as having utf8 as the default) but i dont remember each of them.
I get the exception below. If i use mysql -u user -p I can login as said user. However my app still gets exceptions. I have no idea how i could debug this. What can i check and how might i fix this?
My sites in php seem to access the database. My one C# doesnt and my console app doesn’t. They all use different usernames of course.
MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts.
The error is not user related.
“Unable to connect to any of the specified MySQL hosts“
To me it says that you have configured a (number of) MySQL host(s) that your app is trying to connect to – and failing. Most likely that you bind address change created this problem (why did you do it anyway?)
There may be a number of reasons why:
1) if your SQL server resides on computer with multiple network cards/connections your new configuration may have allowed connection on one of them but not the others.
2) AFAIR http clients were treated slightly differently to direct TCP clients, I think it had something to do with the way http servers were interpreting the SQL server address (I may be completely wrong on this one).