 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
djalig
Joined: 18 Jun 2008 Posts: 2
|
Posted: Wed Jun 18, 2008 8:13 pm Post subject: Mail Queue Error: Cannot connect to database |
|
|
Hi, I am having trouble with Mail_queue
Here are my options:
$container_options = array(
'type' => 'db',
// 'dsn' => 'mysql://username:password@dbname',
'database' => 'localhost/dbname',
'phptype' => 'mysql',
'username' => 'username',
'password' => 'password',
'mail_table' => 'mail_queue'
);
$mail_options = array(
'driver' => 'smtp',
'host' => 'mail.xxxxxxxx.com',
'port' => 587,
'auth' => true,
'username' => 'xxxxxxxx',
'password' => 'xxxxxxxx');
When calling $mail_queue->put( $emailfrom, $to, $headers, $body );
I get the following message:
Mail Queue Error: Cannot connect to database
I am using MAMP on the Mac to run my db. Server is localhost port 8889 for mysql. I have tried both the dsn and db options, with localhost/dbname, localhost:8889/dbname and just dbname but none of the combinations work. The username and password are 100% correct!
Any help would be VERY grateful!
Thanks |
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 911
|
Posted: Wed Jun 18, 2008 10:40 pm Post subject: |
|
|
Mail_Queue doesn't seem to report back the full error message of the DB package.
To test your connection to the database, you can use the following lines of code:
| Code: |
require_once 'DB.php';
$dsn = ...; // either as an array or as a string ('dsn' key of your $container_options variable)
$db =& DB::connect($dsn);
if (DB::isError($db)) {
die($db->getMessage() . ', ' . $db->getDebugInfo());
}
|
With these lines you should get a more helpful message about the connection problem. |
|
| Back to top |
|
 |
djalig
Joined: 18 Jun 2008 Posts: 2
|
Posted: Thu Jun 19, 2008 12:03 am Post subject: |
|
|
Thank you so much.
I needed to use localhost/dbname in the dns string
Everything is now working! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|