Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Installation & Setup
MAMP and invalid data source name
BGJoro
June 2013
Hi all,
I am running MAMP on a Mac and I have problem when trying the 'php oil refine migrate'
it says:
Previous exception:
Uncaught exception PDOException: invalid data source name
my config:
db.php (development)
return array(
'default' => array(
'connection' => array(
'dsn' => 'mysql:host=localhost;dbname=office4',
'username' => 'root',
'password' => 'root',
'port'=>'8889',
),
),
);
when I test connect:
<?php
$dsn = 'mysql:dbname=office4;host=localhost;port=8889';
$user = 'root';
$password = 'root';
try {
$dbh = new PDO($dsn, $user, $password);
echo 'connection is established.';
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}
it works fine.
Any idea why oil would not connect?
BGJoro
June 2013
It works if I use the
unix_socket
to connect to MAMP MYSQL server like:
return array(
'default' => array(
'connection' => array(
'dsn' => 'mysql:unix_socket=/Applications/MAMP/tmp/mysql/mysql.sock;dbname=dbname',
'username' => 'root',
'password' => '',
),
),
);
Syntaxlb
June 2013
Are you sure oil use development environnement ?
Harro
June 2013
http://fuelphp.com/docs/installation/troubleshooting.html#oil_db_error
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
BGJoro
June 2013
Harro
June 2013
Syntaxlb
June 2013