LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-27-2010, 05:55 PM   #1
keirvt
Member
 
Registered: Sep 2006
Location: Sydney Australia
Distribution: fedora/Ubuntu
Posts: 156

Rep: Reputation: 18
MySQL odbc connection remote client


I wish to connect to MySQL using an ODBC connection and I'm using isql to test. On the server connection using isql to local host is sweet however the problem is the client. Okay my set up looks like this
On the server /etc/odbc.ini is
`
[MySQL-scopus2008]
Description = MySQL citation database
Driver = MySQL
Server = localhost
Database = scopus2008
Port = 3306
User = keir
Password = swjsykwim
Socket =
Option =
Stmt =


And the local test look like this
[root@taurinus etc]# isql MySQL-scopus2008
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>


great so far

On my client I can telnet on port 3306 and get a binary type response so I know its not firewall.

odbc.ini is

[MySQL-scopus2008]
Description = MySQL database connector
Driver = {MySQL ODBC 3.51 Driver}
Server = 172.16.176.27
Database = scopus2008
Port = 3306
User = keir
Password = secret
MySQL-scopus2008

isql -v MySQL-scopus2008
[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect



strace shows that the ini file is being accessed and read

open("/etc/odbc.ini", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=182, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb764a000
read(3, "[MySQL-scopus2008]\nDescription ="..., 4096) = 182
read(3, "", 4096) = 0
close(3) = 0
munmap(0xb764a000, 4096) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 5), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb764a000
write(1, "[IM002][unixODBC][Driver Manager"..., 93[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
) = 93
write(2, "[ISQL]ERROR: Could not SQLConnec"..., 34[ISQL]ERROR: Could not SQLConnect
) = 34



I am fairly sure the problem is with the client machine but if anyone has done this or has some suggestions that would be much appreciated
 
Old 07-28-2010, 01:14 PM   #2
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
what about using $HOME/.odbc.ini instead of /etc/odbc.ini?
 
Old 07-28-2010, 04:42 PM   #3
keirvt
Member
 
Registered: Sep 2006
Location: Sydney Australia
Distribution: fedora/Ubuntu
Posts: 156

Original Poster
Rep: Reputation: 18
home suggestion

The trace show /etc/odbc.ini is being consulted however I'll try anything and added the config . $home/odbc.ini

The result is the same.

I there anyone that has configured a remote odbc MySQL connection to a server and perhaps you would be good enought send me your configs.
 
Old 07-29-2010, 07:30 AM   #4
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Quote:
Originally Posted by keirvt View Post
The trace show /etc/odbc.ini is being consulted however I'll try anything and added the config . $home/odbc.ini
Ahem...

It isn't $HOME/odbc.ini
it's
Code:
$HOME/.odbc.ini
like dot odbc dot ini
 
Old 07-29-2010, 11:28 PM   #5
keirvt
Member
 
Registered: Sep 2006
Location: Sydney Australia
Distribution: fedora/Ubuntu
Posts: 156

Original Poster
Rep: Reputation: 18
odbc

Okay so I typoed on the dot. If you run strace you can see that isql accesses the /etc and the $home/.odbc.ini which is in the isql documentation.

It would have been satifying to test the odbc connect with isql from a linux station but without that working I tried from a Windows box. I downloaded the MySQL connection from
http://dev.mysql.com/downloads/connector/odbc/5.1.html
and then configured odbc connector

start->settings->controlpanels->administrativeTools->DataSources(ODBC)
Under the tab "User DSN" click Add
In the GUI presented
DataSourceName MySQL-databasename (in /etc/odbc.ini on server)
Description: Some database decription
Server: server.ucc.usyd.edu.au (port 3306)
User: user1
Password: secret
Database: dataBaseName

and it all works

My ultimate goal was to get Crystal Reports to work with it and that works too. For completeness and possible future Linux applications it would be nice to get isql working but this is not a priority for me now.
 
  


Reply



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
Permit an ODBC connection to my MYSQL database Squidek Ubuntu 2 08-27-2009 08:26 AM
remote connection to MySQL OpusMBE Linux - Software 2 02-28-2007 09:19 AM
Slackware 11 + mysql 5.0.24 + OpenOffice 2.0.3 + ODBC connection bgeddy Slackware 6 01-29-2007 04:42 PM
MySQL Remote Connection aquatux Linux - Server 5 12-26-2006 07:12 PM
ODBC connection to MySQL darius Linux - Software 2 09-29-2003 06:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:08 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
Open Source Consulting | Domain Registration