|
From: Bert A. <ba_...@ya...> - 2009-06-04 01:03:46
|
Hello Ted, I've tried your suggestions, and here are the results : First suggestion: the stray odbc.ini files : I found none, other than those you mentioned that had to be in place. I tried the commands find / -name odbc*.ini -print 2> /users/bertaerts/err.txt and find / -name .odbc*.ini -print 2> /users/bertaerts/err.txt (redirects just to get nuisance warning from stderr out of my view), and all they showed was: /Library/ODBC/odbc.ini /Library/ODBC/odbcinst.ini /Users/bertaerts/Library/ODBC/odbc.ini /Users/bertaerts/Library/ODBC/odbcinst.ini I checked the directories you suggested (I assumed the tilde is my user directory, so /Users/bertaerts) : ls -alpG /Users/bertaerts -> yields no .odbc.ini, nor .odbcinst.ini ls -alpG /etc -> /etc is a symbolic link for /private/etc ls -alpG /private/etc -> no odbc.ini, no .odbc.ini, only a PHP.INI. (For info, I checked the PHP.INI, only reference to ODBC is an active (un-commented) line "extension=php_pdo_odbc.dll" - which, given the extension, is no factor on a Mac.) Secondly, the iodbctest app. I looked up the web manual for MySQL ODBC 5.1 Connector at http://dev.mysql.com/doc/refman/5.1/en/connector-odbc-configuration-connection-parameters.html, and got iodbctest to work : iODBC Demonstration program This program shows an interactive SQL processor Driver Manager: 03.52.0406.1211 Enter ODBC connect string (? shows list): ? DSN | Driver ------------------------------------------------------------------------------ THUIS | MySQL ODBC 5.1 Driver Enter ODBC connect string (? shows list): driver=MySQL ODBC 5.1 Driver;database=thuis;server=localhost;user=root;password=secret_pwd Driver: 05.01.0005 (libmyodbc5.so) SQL>show tables; Tables_in_thuis <lis of my tables> Logically, I immediately pasted this "DSN"-like definition in my connect script - and this failed ... This time, I noticed again something different from last attempts. Before starting the MySQL Server, I executed the following statements: bert-aertss-macbook-pro:~ bertaerts$ export ODBCINI=/Library/ODBC/odbc.ini bert-aertss-macbook-pro:~ bertaerts$ export ODBCSYSINI=/Library/ODBC bert-aertss-macbook-pro:~ bertaerts$ cd /usr/local/mysql/bin bert-aertss-macbook-pro:bin bertaerts$ ./mysqld_safe (i.a.w. http://dev.mysql.com/doc/refman/5.1/en/connector-odbc-configuration-dsn-unix.html . I tried it, because one of your focal points was the default location of an odbc(inst).ini file) The odbc_connect( ) calls using the DSN failed with IM003, those with "driver=...;database=...;" failed with IM002. This is a snippet from the script return to illustrate: Warning: odbc_connect() [function.odbc-connect]: SQL error: [iODBC][Driver Manager]Specified driver could not be loaded, SQL state IM003 in SQLConnect in /Users/bertaerts/Documents/Apache-PHP/DB_thuis/connect.php on line 26 Could not connect to ODBC source 'thuis' with 'root', pwd 'secret_pwd' Warning: odbc_connect() [function.odbc-connect]: SQL error: [iODBC][Driver Manager]Data source name not found and no default driver specified. Driver could not be loaded, SQL state IM002 in SQLConnect in /Users/bertaerts/Documents/Apache-PHP/DB_thuis/connect.php on line 32 Could not connect to ODBC source 'DRIVER={MySQL ODBC 5.1 Driver};DATABASE=thuis;SERVER=localhost' with '', pwd '' I hope this sheds a new light ? Regards ! Bert =====\____/====================================== \@@/ \/ "Bert" by name, Bert Aerts "Bird" by nature +32(11)48.49.06 ================================================= --- On Mon, 6/1/09, Ted Thibodeau Jr <tth...@op...> wrote: From: Ted Thibodeau Jr <tth...@op...> Subject: Re: [Iodbc-macosx] OSX 1.5: ODBC-error IM002 or IM003 using Apache, PHP To: "Bert Aerts" <ba_...@ya...> Date: Monday, June 1, 2009, 9:52 PM Hi, Bert -- You've made significant progress. On Jun 1, 2009, at 03:16 PM, Bert Aerts wrote: > 1) I've added the putenv('ODBCINSTINI=...') statement: no change - but > I admit, my methodology wasn't consistent ... One thing I did notice > however: if I comment both putenv() statements (so the two getenv() > calls yield an empty string), my erro code changes from IM002 to IM003. Interesting. IM002 = Data source name not found and no default driver specified. IM003 = Specified driver could not be loaded. I would normally expect IM002 to occur when $ODBCINI or $ODBCINSTINI or both were unset -- not when both are set correctly and have correct contents. I would not expect IM003 to occur when neither is set, though "default" odbc.ini and/or odbcinst.ini files can be picked up when these variables are unset, if such are present. A file search (through Terminal.app, which reveals files the Finder will overlook) may reveal some otherwise invisible files like -- ~/.odbc.ini ~/.odbcinst.ini /etc/.odbc.ini /etc/odbc.ini -- or similar. The only ones you should retain are -- /Library/ODBC/odbc.ini /Library/ODBC/odbcinst.ini /Users/*/Library/ODBC/odbc.ini <-- one per user /Users/*/Library/ODBC/odbcinst.ini <-- one per user > Enter ODBC connect string (? shows list): DSN=THUIS > 1: SQLDriverConnect = [MySQL][ODBC 5.1 Driver]Prompting is not supported > on this platform. Please provide all required connect information. (0) > SQLSTATE=HY000 This error message indicates that the Driver has successfully been loaded -- but the DSN and/or Connect String did not include all information necessary to make the connection -- and the command-line interface in use does not support prompting for the missing values. I can't offer much more help on this specific connection, as the driver in use is not an OpenLink product, and I'm not intimately familiar with its DSN requirements. You might want to test with one of OpenLink Software's Single-Tier Drivers for MySQL -- <http://download.openlinksw.com/download/product_matrix.vsp?p=l_db&c=28&of=5> -- but do be aware that these are commercial drivers, and do require purchase of a license, after the free evaluation and testing period. During testing, all features are fully enabled; there are no limitations except the expiration date of the license file, which is the only component to be replaced if/when you purchase a permanent license. The "OpenLink ODBC Administrator.app" (/Applications/Utilities/) installed with these drivers includes a DSN Test button, and that may assist you in troubleshooting this or other drivers/DSNs. > 4) binary mismatch, PPC-only, Intel-native mode, ... I'm sorry but I think > you lost me here. I can imagine something like Intel-native mode, but PPC > is new to me (switched to Mac only recently). > Needless o say I have no clue in this case as how to move on. The other information you provided suggests this is not an issue. Be seeing you, Ted --A: Yes. http://www.guckes.net/faq/attribution.html | Q: Are you sure? | | A: Because it reverses the logical flow of conversation. | | | Q: Why is top posting frowned upon? Ted Thibodeau, Jr. // voice +1-781-273-0900 x32 Evangelism & Support // mailto:tth...@op... OpenLink Software, Inc. // http://www.openlinksw.com/ http://www.openlinksw.com/weblogs/uda/ OpenLink Blogs http://www.openlinksw.com/weblogs/virtuoso/ http://www.openlinksw.com/blog/~kidehen/ Universal Data Access and Virtual Database Technology Providers |