I'm having problems connecting to a MySQL server. My app is running on
Solaris, and the server on a linux box. When it tries to connect, I get
back an error:
[unixODBC][MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on
'furball' (2) (2003)
I can use isql to connect to the same server with the same credentials
just fine. That points to my code being broken. However, the same code
compiled and run on a linux box works fine. All machines are using
I watched the packets with ethereal, and I saw that right after the
MySQL server sends a "Server Greeting Protocol" message, the client app
disconnects. Doing the same with isql shows the username and password
being sent to the server.
I tried to trace through the unixODBC code, but can't trace through the
SQLCONNECT macro ( 3819 in DriverMangerSQLconnect.c ). From what I
gather, its at that point that it calls the driver code.
I tried to turn on tracing in the odbc.ini file, but nothing gets
written. Is there some magic I can invoke to get the mysql driver to
give more information? I don't know what the "(2) (2003)" at the end of
the error message mean.
Re: problem with SQL connect on Solaris with MySQL
Eric Sharkey wrote:
> Driver manager tracing is enabled in odbcinst.ini, not odbc.ini.
> Just add:
> Trace = Yes
> If you add that to odbc.ini instead of odbcinst.ini, it will be ignored.
For some reason this does not work on solaris. When I commented out that
line, it worked fine. I tried increasing the timeout to 30 seconds, but
that didn't make any difference. In the log file, I could see that the
value was being set. Its still a mystery to me why this causes a problem
on solaris, but not linux. Maybe a problem with the MySQL driver?