|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
RE: RE: Problem with unixODBC and MySQL
Couple things to look at...number one, it doesn't look like you have the proper parameter names in the odbc.ini file...for instance, Username should be user, Servername should be server ...
http://www.mysql.com/doc/en/MyODBC_connect_parameters.html Also, did you compile MyODBC? Did you configure it with: ./configure --with-unixODBC ?? |
|
#3
|
|||
|
|||
|
RE: RE: Problem with unixODBC and MySQL
According to all the literature, the parameters seem to be correct. MyODBC isn't compiled, (at least the version (3.5) I downloaded didn't need to be), it's just a collection of libraries/drivers...
In any case, I re-installed the package and can now connect. Thanks for the help Josh Lewis |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > RE: Problem with unixODBC and MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|