MDB2->MySQL on Ubuntu 6.06 (dapper)

From: Date: Fri, 11 Apr 2008 12:40:06 +0000
Subject: MDB2->MySQL on Ubuntu 6.06 (dapper)
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-28783@lists.php.net to get a copy of this message
Hello all, I am trying to get Pear's MDB2_Driver_mysql to work and I'm having no luck. I am on Ubuntu 6.06 (Dapper). I have a non-standard location for mysql.sock, as well as a non-standard tcp port (thank you Zimbra!) so the module can't find it. Even when I use the mysql://user:pass@unix(/path/to/socket)/database syntax or the mysql://user:pass@tcp(localhost:7307)/database syntax, I cannot connect, and I get the following error. Note the part at the end about "Unknown MySQL server host 'unix'". It looks to me like the MDB2 module is not parsing the DSN as documented, or I'm not reading the documentation properly: root@u15286844:/usr/share/php/DB/DataObject# php createTables.php dataobject.ini Warning: Error parsing dataobject.ini on line 3 in /usr/share/php/DB/DataObject/createTables.php on line 40 DB_DataObject_Generator : 0 : CREATING FOR 0 DB_DataObject_Generator : CONNECT : NEW CONNECTION DB_DataObject_Generator : CONNECT : mysql://user:password@unix a37c13227a75b3443abe7ab460a9674a DB_DataObject_Generator : CONNECT : a:1:{s:32:"a37c13227a75b3443abe7ab460a9674a";O:8:"DB_Error":8:{s:20:"error_message_prefix";s:0:"";s:4:"mode";i:1;s:5:"level";i:1024;s:4:"code";i:-24;s:7:"message";s:24:"DB Error: connect failed";s:8:"userinfo";s:82:" [nativecode=Unknown MySQL server host 'unix' (1)] ** mysql://user:password@unix";s:9:"backtrace";a:9:{i:0;a:6:{s:4:"file";s:21:"/usr/share/php/DB.php";s:4:"line";i:966;s:8:"function";s:10:"PEAR_Error";s:5:"class";s:10:"PEAR_Error";s:4:"type";s:2:"->";s:4:"args";a:5:{i:0;s:24:"DB Error: connect failed";i:1;i:-24;i:2;i:1;i:3;i:1024;i:4;s:50:" [nativecode=Unknown MySQL server host 'unix' (1)]";}}i:1;a:7:{s:4:"file";s:23:"/usr/share/php/PEAR.php";s:4:"line";i:574;s:8:"function";s:8:"DB_Error";s:5:"class";s:8:"DB_Error";s:6:"object";r:2;s:4:"type";s:2:"->";s:4:"args";a:4:{i:0;i:-24;i:1;i:1;i:2;i:1024;i:3;s:50:" [nativecode=Unknown MySQL server host 'unix' (1)]";}}i:2;a:7:{s:4:"file";s:28:"/usr/share/php/DB/common.php";s:4:"line";i:1903;s:8:"function";s:10:"raiseError";s:5:"class";s:4:"PEAR";s:6:"object";O:8:"DB_mysql":8:{s:10:"autocommit";b:1;s:8:"dbsyntax";s:5:"mysql";s:3:"dsn";a:9:{s:7:"phptype";s:5:"mysql";s:8:"dbsyntax";s:5:"mysql";s:8:"username";s:6:"urefer";s:8:"password";s:8:"uR3f3rDB";s:8:"protocol";s:3:"tcp";s:8:"hostspec";s:4:"unix";s:4:"port";b:0;s:6:"socket";b:0;s:8:"database";b:0;}s:8:"features";a:7:{s:5:"limit";s:5:"alter";s:8:"new_link";s:5:"4.2.0";s:7:"numrows";b:1;s:8:"pconnect";b:1;s:7:"prepare";b:0;s:3:"ssl";b:0;s:12:"transactions";b:1;}s:9:"fetchmode";i:1;s:22:"fetchmode_object_class";s:8:"stdClass";s:7:"options";a:8:{s:16:"result_buffering";i:500;s:10:"persistent";b:0;s:3:"ssl";b:0;s:5:"debug";i:0;s:14:"seqname_format";s:6:"%s_seq";s:8:"autofree";b:0;s:11:"portability";i:0;s:8:"optimize";s:11:"performance";}s:13:"was_connected";b:0;}s:4:"type";s:2:"->";s:4:"args";a:7:{i:0;N;i:1;i:-24;i:2;N;i:3;N;i:4;s:50:" [nativecode=Unknown MySQL server host 'unix' (1)]";i:5;s:8:"DB_Error";i:6;b:1;}}i:3;a:7:{s:4:"file";s:27:"/usr/share/php/DB/mysql.php";s:4:"line";i:252;s:8:"function";s:10:"raiseError";s:5:"class";s:9:"DB_common";s:6:"object";r:39;s:4:"type";s:2:"->";s:4:"args";a:5:{i:0;i:-24;i:1;N;i:2;N;i:3;N;i:4;s:36:"Unknown MySQL server host 'unix' (1)";}}i:4;a:7:{s:4:"file";s:21:"/usr/share/php/DB.php";s:4:"line";i:556;s:8:"function";s:7:"connect";s:5:"class";s:8:"DB_mysql";s:6:"object";r:39;s:4:"type";s:2:"->";s:4:"args";a:2:{i:0;a:9:{s:7:"phptype";s:5:"mysql";s:8:"dbsyntax";s:5:"mysql";s:8:"username";s:6:"urefer";s:8:"password";s:8:"uR3f3rDB";s:8:"protocol";s:3:"tcp";s:8:"hostspec";s:4:"unix";s:4:"port";b:0;s:6:"socket";b:0;s:8:"database";b:0;}i:1;b:0;}}i:5;a:7:{s:4:"file";s:32:"/usr/share/php/DB/DataObject.php";s:4:"line";i:2241;s:8:"function";s:7:"connect";s:5:"class";s:2:"DB";s:6:"object";O:23:"DB_DataObject_Generator":19:{s:6:"tables";N;s:12:"_definitions";N;s:5:"table";N;s:10:"_newConfig";N;s:8:"_extends";s:13:"DB_DataObject";s:12:"_extendsFile";s:17:"DB/DataObject.php";s:10:"_className";N;s:22:"_DB_DataObject_version";s:5:"1.8.8";s:7:"__table";s:0:"";s:1:"N";i:0;s:13:"_database_dsn";s:28:"mysql://user:password@unix";s:17:"_database_dsn_md5";s:32:"a37c13227a75b3443abe7ab460a9674a";s:9:"_database";i:0;s:6:"_query";a:7:{s:9:"condition";s:0:"";s:8:"group_by";s:0:"";s:8:"order_by";s:0:"";s:6:"having";s:0:"";s:11:"limit_start";s:0:"";s:11:"limit_count";s:0:"";s:11:"data_select";s:1:"*";}s:12:"_DB_resultid";N;s:13:"_resultFields";b:0;s:12:"_link_loaded";b:0;s:5:"_join";s:0:"";s:10:"_lastError";b:0;}s:4:"type";s:2:"->";s:4:"args";a:1:{i:0;s:28:"mysql://user:password@unix";}}i:6;a:7:{s:4:"file";s:42:"/usr/share/php/DB/DataObject/Generator.php";s:4:"line";i:175;s:8:"function";s:8:"_connect";s:5:"class";s:13:"DB_DataObject";s:6:"object";r:118;s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:7;a:7:{s:4:"file";s:42:"/usr/share/php/DB/DataObject/Generator.php";s:4:"line";i:144;s:8:"function";s:16:"_createTableList";s:5:"class";s:23:"DB_DataObject_Generator";s:6:"object";r:118;s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:8;a:7:{s:4:"file";s:45:"/usr/share/php/DB/DataObject/createTables.php";s:4:"line";i:58;s:8:"function";s:5:"start";s:5:"class";s:23:"DB_DataObject_Generator";s:6:"object";O:23:"DB_DataObject_Generator":19:{s:6:"tables";N;s:12:"_definitions";N;s:5:"table";N;s:10:"_newConfig";N;s:8:"_extends";s:13:"DB_DataObject";s:12:"_extendsFile";s:17:"DB/DataObject.php";s:10:"_className";N;s:22:"_DB_DataObject_version";s:5:"1.8.8";s:7:"__table";s:0:"";s:1:"N";i:0;s:13:"_database_dsn";s:0:"";s:17:"_database_dsn_md5";s:0:"";s:9:"_database";s:0:"";s:6:"_query";a:7:{s:9:"condition";s:0:"";s:8:"group_by";s:0:"";s:8:"order_by";s:0:"";s:6:"having";s:0:"";s:11:"limit_start";s:0:"";s:11:"limit_count";s:0:"";s:11:"data_select";s:1:"*";}s:12:"_DB_resultid";N;s:13:"_resultFields";b:0;s:12:"_link_loaded";b:0;s:5:"_join";s:0:"";s:10:"_lastError";b:0;}s:4:"type";s:2:"->";s:4:"args";a:0:{}}}s:8:"callback";N;}} DB_DataObject_Generator : CONNECT FAILED : [db_error: message="DB Error: connect failed" code=-24 mode=return level=notice prefix="" info=" [nativecode=Unknown MySQL server host 'unix' (1)] ** mysql://user:password@unix"] DB_DataObject_Generator : ERROR : Connect failed, turn on debugging to 5 see why DB_DataObject Error: Connect failed, turn on debugging to 5 see why I have the following ini file: [DB_DataObject] database = mysql://user:password@unix(/opt/zimbra/db/mysql.sock)/dev schema_location = /usr/local/php_includes/dev.urefer.com/db class_location = /usr/local/php_includes/dev.urefer.com/db require_prefix = db/ class_prefix = db_ db_driver = MDB2 quote_identifiers = 1 debug = 5 ...and the following php-related Ubuntu packages: ii libapache2-mod-php5 5.1.2-1ubuntu3.10 server-side, HTML-embedded scripting languag ii php-net-socket 1.0.6-2 PHP PEAR Network Socket Interface module ii php-pear 5.1.2-1ubuntu3.10 PEAR - PHP Extension and Application Reposit ii php5-cgi 5.1.2-1ubuntu3.10 server-side, HTML-embedded scripting languag ii php5-cli 5.1.2-1ubuntu3.10 command-line interpreter for the php5 script ii php5-common 5.1.2-1ubuntu3.10 Common files for packages built from the php ii php5-gd 5.1.2-1ubuntu3.10 GD module for php5 ii php5-mcrypt 5.1.2-1 MCrypt module for php5 ii php5-mysql 5.1.2-1ubuntu3.10 MySQL module for php5 ii php5-mysqli 5.1.2-1ubuntu3.10 MySQL Improved module for php5 ii phpmyadmin 2.8.0.3-1ubuntu0.1 set of PHP-scripts to administrate MySQL ove ...and the following Pear modules: Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.2 stable Console_Getopt 1.2.3 stable DB 1.7.13 stable DB_DataObject 1.8.8 stable Date 1.4.7 stable MDB2 2.4.1 stable MDB2_Driver_mysql 1.4.1 stable MDB2_Driver_mysqli 1.4.1 stable PEAR 1.7.1 stable Structures_Graph 1.0.2 stable Any help would be greatly appreciated. -- David Thibault Director of Technology u Refer Rewarding Connections .™ p: 734.418.2537 m: 734.846.6911 dthibault@uRefer.com | http://www.uRefer.com

« previous php.pear.general (#28783) next »