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.
General
This morning I got an error from connection.php
soseki
July 2019
Hello there,
My batch program suddenly got following error for 3 times.
2002 - SQLSTATE[HY000] [2002]
No such file or directory
in ..../fuel/core/classes/database/pdo/connection.php
Do you have any suggestion why I am getting this errors?
mysql Ver 14.14 Distrib 5.7.27, for Linux (x86_64)
PHP 7.0.33-0ubuntu
Best regards,
Harro
July 2019
It means PDO can't connect to the database, so either your DB config is wrong, or your programme can't find the correct config.
Most common error are:
* using a socket while you need to connect to an IP
* using "localhost" instead of 127.0.0.1 (on some platforms)
soseki
July 2019
Thanks for your comments.
However, my batch is up and running without any issue after these errors as well as my front-end app.
My config file seems fine for me.
Here is my config.
return array(
'default' => array(
'connection' => array(
'dsn' => 'mysql:host=localhost;dbname=mydb',
'username' => 'username',
'password' => 'password',
),
);
This is weird for me.
Harro
July 2019
Accepted Answer
Does the server run a dual stack, or is IPv6 completely disabled?
If not, change it to
'dsn' => 'mysql:host=127.0.0.1;dbname=mydb',
If you develop on a Mac, you should do the same.
soseki
July 2019
Okay, thanks for that.
I will do it.
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,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
July 2019
soseki
July 2019