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