Roundcube Community Forum

 

Can't connect to the database

Started by richstock, December 13, 2006, 08:21:08 AM

Previous topic - Next topic

richstock

Normally on PHP I have to connect to my mysql database like below:

mysql_connect("localhost:3306:/home/server/mysql/mysql.sock","username","password");

How can I get this working on roundcube?

I tried this in the database settings file:
$rcmail_config['db_dsnw'] = 'mysql://username:password@localhost:3306:/home/server/mysql.sock/roundcube';


richstock

but then it's trying to connect through the default socket as defined in the php info which doesn't work on my server?

looking in the error log it give this error:
[13-Dec-2006 13:36:09 +0000] DB Error: DB Error: connect failed in /home/***/www/*******/program/include/rcube_db.inc on line 105

So basically I need to know how to define the Unix socket when using the DB:connect function.

richstock

Just in case anyone needs this in the future:

I managed to get round it by setting the configuration as:

 $rcmail_config['db_dsnw'] = array('phptype'=>'mysql','username'=>'username','password'=>'password','protocol' => 'unix', 'hostspec' => 'host', 'socket' => 'socket location', 'database' => 'database');

Zard

hey richstock,

i have exactly the same problem and after hours of searching found your post and solution. unfortunately, i don't understand your php line...

if my mysql 5 connection settings are as follows...
Host: localhost | Socket: /tmp/mysql5.sock

... what would your line of code need to look like?
i'd very much appreciate your help!

thanks,
Zard

Prasad1337


freek

Hey richstock,

thank you very much for this solution!
I have also been looking for hours why RoundCube couldn't connect to my database. Until I discovered that it was looking at the wrong place for the socket file.

Thanks to your post I finally succeeded in getting roundcube running!

Freek