[unixODBC-support] problem with MySQL Connector with unixODBC in Mac OSX

barsalou barjunk at attglobal.net
Thu Sep 6 03:13:30 BST 2012


Carlos,

It is likely that the my.cnf file used from the client side of your  
connection (namely the Mac) has a setting to the socket file.

You will have to change that to point to the needed host.

I'm not familiar enough with under the hood of the Mac to give you a  
step by step, but googling has mentioned that it will likely be in  
/etc/my.cnf

Or it could possibly be a dot-file in your home directory ~/.my.cnf

Mike B.

Quoting Carlos Andrey <carlosandrey at gmail.com>:

> Good afternoon,
>
> the MySQL server is not working in Mac is running in another   
> machine, for that reason the file /tmp/mysql.sock must doesn't exist.
>
> for me, the unixODBC think the server is locally, but isn't it
>
> thanks for your help,
> Carlos Andrey Montoya
> Skype:andr3w
> carlosandrey at gmail.com
>
>
> El 4/09/2012, a las 12:31, barsalou escribió:
>
>>
>> Carlos,
>>
>> From the error, it looks as though something is configured on your   
>> MAC to look for the MySQL connection on the socket /tmp/mysql.sock.
>>
>> Does this file exist?
>>
>> if not, it is likely something is misconfigured.
>>
>> You didn't mention if MySQL is working with it's own standard tools  
>>  when trying to talk with the MySQL server on the MAC.
>>
>> Mike Barsalou
>>
>> Quoting Carlos Andrey <carlosandrey at gmail.com>:
>>
>>> Good afternoon,
>>>
>>> i have recently installed unixODBC 3.5.1 with MySQL connect 5.1.11  
>>>   in mi MAC OSX Lion. i have worked with unixODBC in my Linux   
>>> without  a problem, but i don't make running with OSX.
>>>
>>> the MySQL server is running in a linux machine.
>>>
>>> my odbcinst.ini is
>>>
>>> [ODBC]
>>> Trace File=/tmp/sql.log
>>> Trace=yes
>>> Pooling=No
>>> UsageCount=3
>>>
>>> [ODBC Connection Pooling]
>>> PerfMon=0
>>> Retry Wait=
>>> UsageCount=8
>>>
>>> [ODBC Drivers]
>>> MySQL5.1=Installed
>>> UsageCount=2
>>>
>>> [MySQL5.1]
>>> Driver=/usr/local/lib/libmyodbc5.so
>>> Setup=
>>> Description=ODBC for MySQL 5.1
>>> Driver64=/usr/local/lib/libmyodbc5.so
>>> FileUsage=1
>>> UsageCount=15
>>>
>>>
>>> my odbc.ini is
>>> [ODBC]
>>> Trace=yes
>>> TraceAutoStop=0
>>> TraceFile=/tmp/sqllog.log
>>> TraceLibrary=
>>>
>>> [ODBC Data Sources]
>>> db01=MySQL5.1
>>>
>>> [db01]
>>> Driver=MySQL5.1
>>> Description=Base de Datos MySQL
>>> port=3306
>>> database=portnetdllo
>>> option=3
>>> user=root
>>> password=password
>>> server=192.168.130.50
>>>
>>> evidently i have permission in my DB for the root user and my Mac IP
>>>
>>> when i just try to connect with isql the error is:
>>> [08S01][unixODBC][MySQL][ODBC 5.1 Driver]Can't connect to local    
>>> MySQL server through socket '/tmp/mysql.sock' (2)
>>> [ISQL]ERROR: Could not SQLConnect
>>>
>>> when i see the log error i can see:
>>>
>>> [ODBC][27293][1346729968.849228][__handles.c][460]
>>>                Exit:[SQL_SUCCESS]
>>>                        Environment = 0x7f9821000000
>>> [ODBC][27293][1346729968.849510][SQLAllocHandle.c][375]
>>>                Entry:
>>>                        Handle Type = 2
>>>                        Input Handle = 0x7f9821000000
>>> [ODBC][27293][1346729968.849665][SQLAllocHandle.c][493]
>>>                Exit:[SQL_SUCCESS]
>>>                        Output Handle = 0x7f9821020400
>>> [ODBC][27293][1346729968.850799][SQLConnect.c][3700]
>>>                Entry:
>>>                        Connection = 0x7f9821020400
>>>                        Server Name = [db01][length = 4 (SQL_NTS)]
>>>                        User Name = [NULL]
>>>                        Authentication = [NULL]
>>>                UNICODE Using encoding ASCII 'char' and UNICODE    
>>> 'UCS-2-INTERNAL'
>>>
>>>                DIAG [08S01] [MySQL][ODBC 5.1 Driver]Can't connect   
>>>  to local MySQL server through socket '/tmp/mysql.sock' (2)
>>>
>>> [ODBC][27293][1346729968.864320][SQLConnect.c][4067]
>>>                Exit:[SQL_ERROR]
>>> [ODBC][27293][1346729968.864618][SQLError.c][434]
>>>                Entry:
>>>                        Connection = 0x7f9821020400
>>>                        SQLState = 0x7fff61f7c871
>>>                        Native = 0x7fff61f7c86c
>>>                        Message Text = 0x7fff61f7c87b
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fff61f7c86a
>>> [ODBC][27293][1346729968.865006][SQLError.c][471]
>>>                Exit:[SQL_SUCCESS]
>>>                        SQLState = 08S01
>>>                        Native = 0x7fff61f7c86c -> 2002
>>>                        Message Text = [[unixODBC][MySQL][ODBC 5.1   
>>>  Driver]Can't connect to local MySQL server through socket    
>>> '/tmp/mysql.sock' (2)]
>>> [ODBC][27293][1346729968.865474][SQLError.c][434]
>>>                Entry:
>>>                        Connection = 0x7f9821020400
>>>                        SQLState = 0x7fff61f7c871
>>>                        Native = 0x7fff61f7c86c
>>>                        Message Text = 0x7fff61f7c87b
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fff61f7c86a
>>> [ODBC][27293][1346729968.865606][SQLError.c][471]
>>>                Exit:[SQL_NO_DATA]
>>> [ODBC][27293][1346729968.865772][SQLError.c][514]
>>>                Entry:
>>>                        Environment = 0x7f9821000000
>>>                        SQLState = 0x7fff61f7c871
>>>                        Native = 0x7fff61f7c86c
>>>                        Message Text = 0x7fff61f7c87b
>>>                        Buffer Length = 500
>>>                        Text Len Ptr = 0x7fff61f7c86a
>>> [ODBC][27293][1346729968.865976][SQLError.c][551]
>>>                Exit:[SQL_NO_DATA]
>>> [ODBC][27293][1346729968.866363][SQLFreeHandle.c][284]
>>>                Entry:
>>>                        Handle Type = 2
>>>                        Input Handle = 0x7f9821020400
>>> [ODBC][27293][1346729968.866731][SQLFreeHandle.c][333]
>>>                Exit:[SQL_SUCCESS]
>>> [ODBC][27293][1346729968.867101][SQLFreeHandle.c][219]
>>>                Entry:
>>>                        Handle Type = 1
>>>                        Input Handle = 0x7f9821000000
>>>
>>> when i review the log i notice in this segment:
>>>                       Server Name = [db01][length = 4 (SQL_NTS)]
>>>                        User Name = [NULL]
>>>                        Authentication = [NULL]
>>>
>>> in Server Name is not taking the real server name and isn't taking  
>>>   user and password neither
>>>
>>> please help me
>>>
>>> regards,
>>>
>>> Carlos Andrey Montoya
>>> Skype:andr3w
>>> carlosandrey at gmail.com
>>>
>>>
>>>
>>
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>> _______________________________________________
>> unixODBC-support mailing list
>> unixODBC-support at mailman.unixodbc.org
>> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
>
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the unixODBC-support mailing list