LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-05-2003, 11:46 AM   #1
thestewart
LQ Newbie
 
Registered: Sep 2003
Location: West Midlands, UK
Distribution: SuSE
Posts: 6

Rep: Reputation: 0
Using unixODBC With a Remote MySQL Server


I want to connect to a remote MySQL server using unixODBC.

My odbc.ini file is:

----------------------------------
[MySQL-test]
driver = MySQL
description = MySQL-test
server = 192.168.1.101
database = test
port = 3306
----------------------------------

My odbcinst.ini file is:

----------------------------------
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libiodbc/libmyodbc.so
FileUsage = 1
----------------------------------

When I try and connect using isql it says:

[unixODBC]
[TCX]
[MyODBC]
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[ISQL]ERROR: Could not SQLConnect

It's trying to connect to localhost even though I've said server = 192.168.1.101. How can I get it to connect to 192.168.1.101 and not localhost?

Thanks in advance.

Last edited by thestewart; 10-07-2003 at 12:21 PM.
 
Old 10-07-2003, 12:21 PM   #2
thestewart
LQ Newbie
 
Registered: Sep 2003
Location: West Midlands, UK
Distribution: SuSE
Posts: 6

Original Poster
Rep: Reputation: 0
I had another look and I've managed to work it out.

odbc.ini
----------------------------------
[ODBC Data Sources]
MySQL-test = ODBC for MySQL with database test

[MySQL-test]
driver = MySQL
server = faye
database = test
port = 3306
address = faye:3306
user = test
username = test
----------------------------------

odbcinst.ini
----------------------------------
[ODBC Drivers]
MySQL = installed

[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libiodbc/libmyodbc.so
FileUsage = 1
----------------------------------
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't get remote access to mysql server hughes28105 SUSE / openSUSE 6 09-17-2005 10:07 PM
connecting to remote MySQL server acos7 Linux - Software 2 01-31-2004 12:37 AM
Remote Connection to mysql server Graanco Linux - General 1 07-19-2003 12:27 AM
MySQl and MyODBC and unixODBC LandRoverMan Linux - Software 0 06-20-2003 01:42 PM
MySQL and uniXODBC LandRoverMan Linux - Software 0 06-09-2003 01:13 PM


All times are GMT -5. The time now is 04:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration