Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > MySQL > RE: Problem with unixODBC and MySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-09-03, 05:09
joshlewis joshlewis is offline
Registered User
 
Join Date: Dec 2003
Posts: 4
RE: Problem with unixODBC and MySQL

I'm using Red Hat 9 with Apache (not sure which ver), PHP 4, MySQL 4.0.16 and unixODBC (from unixODBC) and the standard libraries which come with it.

I've set up numerous DSN's, using both the standard MySQL driver (libodbcmyS.so) and the MyODBC 3 library (libmyodbc3.so). As far as I can tell. I've set up the DSNs correctly, using both ODBCConfig, and by editing the .ini files directly. However, whenever I try to connect to one of the DSNs, (either with isql or PHP) I get the following error:

Warning: SQL error: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed, SQL state IM004 in SQLConnect

I've searched for the rror string on Google and other places, but have had no success. It seems to me that the DSN is obviously not set up correctly, or cannot connect to the MySQL server. I know the MySQL server works, as I've accessed it via PHP, and directly.

A copy of the odbc.ini (server DSN fi;le) is given below:

[ODBC Data Sources]

[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libodbcmyS.so
Database = test
Servername = localhost
Username = "root"
Password = ""
Port =

A copy of the odbcinst.ini is given below:
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libodbcmyS.so
Setup =
FileUsage = 1
CPTimeout =
CPReuse =


root@localhost (without a password) is allowed full access to the MySQL server; and I've also tried using several username - password pairs, but this doesn't change anything.

Any help would be greatly appreciated.

Thanks in advance
Josh Lewis
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On