Maybe php5-mysql support not enabled ? You could try a plain php file to test without cakephp
<?php mysql_connect("localhost", "admin", "secret") or die(mysql_error()); echo "Connected to MySQL<br />"; mysql_select_db("cake") or die(mysql_error()); echo "Connected to Database"; ?> 'Andras Kende http://www.kende.com On Nov 5, 2011, at 10:25 PM, Tim Dunphy wrote: > Hello and thanks for your reply.. > > I tried removing the port setting as you've suggested and moved from > cake 1.3 to cake 2.0 but the result was the same! > > class DATABASE_CONFIG { > > public $default = array( > 'datasource' => 'Database/Mysql', > 'persistent' => false, > 'host' => 'localhost', > 'login' => 'admin', > 'password' => 'secret', > 'database' => 'cake', > 'prefix' => '', > //'encoding' => 'utf8', > ); > > public $test = array( > 'datasource' => 'Database/Mysql', > 'persistent' => false, > 'host' => 'admin', > 'login' => 'root', > 'password' => 'secret', > 'database' => 'cakeblog', > 'prefix' => '', > //'encoding' => 'utf8', > ); > } > > On Sat, Nov 5, 2011 at 10:03 PM, Ma'moon <phpir...@gmail.com> wrote: >> Most likely you need to leave the port section empty in your db >> configuration >> >> On Sat, Nov 5, 2011 at 9:55 PM, bluethundr <bluethu...@gmail.com> wrote: >>> >>> ## cake cannot connect to the databse >>> >>> Your tmp directory is writable. >>> >>> The FileEngine is being used for caching. To change the config edit >>> APP/config/core.php >>> >>> Your database configuration file is present. >>> >>> Cake is NOT able to connect to the database. >>> >>> ## database config file >>> >>> >>> class DATABASE_CONFIG { >>> >>> var $default = array( >>> 'driver' => 'mysql', >>> 'persistent' => false, >>> 'host' => 'localhost', >>> 'login' => 'admin', >>> 'password' => 'secret', >>> 'database' => 'cake', >>> 'prefix' => '', >>> 'port' => '/var/lib/mysql/mysql.sock', >>> //'encoding' => 'utf8', >>> ); >>> >>> var $test = array( >>> 'driver' => 'mysql', >>> 'persistent' => false, >>> 'host' => 'localhost', >>> 'login' => 'admin', >>> 'password' => 'secret', >>> 'database' => 'cakeblog', >>> 'prefix' => '', >>> 'port' => '/var/lib/mysql/mysql.sock', >>> //'encoding' => 'utf8', >>> ); >>> } >>> >>> >>> >>> ## user can connect to (and use) database on the command line >>> >>> >>> [root@cloud cake]# mysql -uadmin -psecret >>> Welcome to the MySQL monitor. Commands end with ; or \g. >>> Your MySQL connection id is 2 >>> Server version: 5.5.17-log MySQL Community Server (GPL) by Remi >>> >>> Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights >>> reserved. >>> >>> Oracle is a registered trademark of Oracle Corporation and/or its >>> affiliates. Other names may be trademarks of their respective >>> owners. >>> >>> Type 'help;' or '\h' for help. Type '\c' to clear the current input >>> statement. >>> >>> mysql> use cake >>> Database changed >>> >>> thank you! >>> >>> -- >>> Our newest site for the community: CakePHP Video Tutorials >>> http://tv.cakephp.org >>> Check out the new CakePHP Questions site http://ask.cakephp.org and help >>> others with their CakePHP related questions. >>> >>> >>> To unsubscribe from this group, send email to >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group >>> at http://groups.google.com/group/cake-php >> >> -- >> Our newest site for the community: CakePHP Video Tutorials >> http://tv.cakephp.org >> Check out the new CakePHP Questions site http://ask.cakephp.org and help >> others with their CakePHP related questions. >> >> >> To unsubscribe from this group, send email to >> cake-php+unsubscr...@googlegroups.com For more options, visit this group at >> http://groups.google.com/group/cake-php >> > > > > -- > GPG me!! > > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php