Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
MAMP Mysql config failing had to hard code
  • I'm no PHP whiz so here goes: tried setting 'dsn' in DEVELOPMENT config to my MAMP Mysql socket (/Applications/MAMP/tmp/mysql/mysql.sock) and I kept getting -> Error: PDO::__construct(): [2002] Operation timed out (trying to connect via tcp:///Applications/MAMP/tmp/mysql/mysql.sock:3306) so I googled the error and found this -> I then tried 'dsn' mysql:unix_socket=/Applications/MAMP/tmp/mysql/mysql.sock
    which also didn;t work I then hard coded it into connection.php
    $this->_connection = new \PDO('mysql:unix_socket=/Applications/MAMP/tmp/mysql/mysql.sock;dbname=dogfood_development', $username, $password, $attrs); which worked can someone explain?
  • I don't have an immediate explaination for this. I went through the code, but the config as defined in the db configuration file is simply extracted from the array and passed to PDO(). What does $dsn contain before the connection is created? And is it exactly as you have typed it in?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion