Page 1 of 1

MySQL Connect Problem

Posted: Mon Feb 08, 2010 9:28 am
by rodrigophp
Hi,

I have the following:

Code: Select all

 
 
$_host = $DHOY_CONFIG['db'][$connection_name]['host'];
 
            $_name = $DHOY_CONFIG['db'][$connection_name]['name'];
 
            $_port = $DHOY_CONFIG['db'][$connection_name]['port'];
 
            $_user = $DHOY_CONFIG['db'][$connection_name]['user'];
 
            $_pass = $DHOY_CONFIG['db'][$connection_name]['pass'];
 
 
 
            $dsn = "mysql://$_user:$_pass@$_host:$_port/$_name?new_link=true";
 
            
 
            print "dsn is $dsn";
 
 
 
            if ($dsn != 'mysql://:@:/?new_link=true') {
 
                $db_connection[$connection_name] = DB::connect($dsn);
 
 
 
                if (!DB::isError($db_connection[$connection_name])) {
 
                    return $db_connection[$connection_name];
 
                } else {
 
                    trigger_error("General system error ID: 00002 - DSN empty", E_USER_ERROR);
the DSN looks fine: mysql://loquo_r:r@127.0.0.1:3306/loquo_test?new_link=true

getMessage() gives me a "Connect Failed" error, I have been looking over the internet, but I haven't found any solution and the message isn't very clear

I have tried to connect from the cmd and it works with "mysql -uloquo_r -pr -Dloquo_test"

I don't if there is something trivial I am missing or what.

any idea?

Thanks in advance.