Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have xampp installed and want to get FuelPHP working. Everything seems to work fine, I scaffolded some stuff, that I want to migrate. But I get the error

Error - invalid data source name in COREPATH/classes/database/pdo/connection.php on line 94

My db.php looks like this:

return array(
  'default' => array(
    'type' => 'pdo',
    'connection' => array(
      'dsn' => 'mysql:host=127.0.0.1;dbname=pfpg',
      'username' => 'root',
      'password' => '',
      'persistent' => false,
      'compress' => false,
    ),
  ),
);

I tried it without the 'persistent' and 'compress' before, didn't work. Database name is correct, username too. I also tried it with 'mysql:host=localhost'. I don't get what I did wrong...

If you need more information, ask away!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
177 views
Welcome To Ask or Share your Answers For Others

1 Answer

I configured the wrong db.php file, I didn't know, there was more than one. fuel/app/config/development/db.php was the right file, so it depends on the environment


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...