0 Replies - 3329 Views - Last Post: 29 August 2012 - 02:28 AM Rate Topic: -----

#1 Duckington  Icon User is offline

  • D.I.C Addict

Reputation: 172
  • View blog
  • Posts: 614
  • Joined: 12-October 09

ODBC - Data Source Name Too Long

Posted 29 August 2012 - 02:28 AM

Not sure if this should be in DBs or Linux forum..

ANyway, i've been trying to install the ODBC extension for PHP onto one of our servers (Redhat), and i think it got it installed correctly but now when i try to test the connection i get the error message about the data source name being too long... It sounds like a simple thing to fix, but i can't work out..how..or where.

Basically these are the settings i've got at the moment:

# odbcinst -j
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN SIze.......: 4

I've got my MySQL driver defined in the odbcinst.ini as such:

Description    = ODBC for MySQL
Driver         = /usr/lib/libmyodbc5.so
Setup          = /usr/lib/libodbcmyS.so
FileUsage      = 1

I've double checked and the Driver & Setup paths are correct and pointing to the correct files.

So now I'm trying to add a System Data Source by editing the odbc.ini file. I've tried it in various different formats, following examples from different sites, e.g.


As you can see i've commented some of them out and tried different ones:

;driver = MySQL
;Database = moodle
;Server = localhost
;Socket = /var/lib/mysql/mysql.sock

;Description = MySQL
;Driver      = MySQL
;SERVER      = localhost
;USER        = root
;PORT        = 3306
;DATABASE    = moodle

Driver	     = /usr/lib/libmyodbc5.so
Description  = Connector/ODBC 5 Driver DSN
SERVER	     = localhost
PORT	     =
USER         = root
Password     =
Database     = moodle
SOCKET       =	

However, whenever i run isql -v to see if there are any problems, i always get:

[IM010][unixODBC][Driver Manager]Data source name too long
[ISQL]ERROR: Could not SQLConnect

My googling around the error only ever seems to turn up results for people having a connection string within something like ASP, nothing about how to get it working on the server in this way...

Could anyone offer me any advice/help? :withstupid: :dontgetit:

Thank you!

Is This A Good Question/Topic? 0
  • +

Page 1 of 1