Forums / General Questions / mysqli_connect(): (HY000/2002): No such file or directory

mysqli_connect(): (HY000/2002): No such file or directory

Views: 6,852

Results 1 to 20 of 25
1 Aug 2015, 9:43 PM
#1
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

mysqli_connect(): (HY000/2002): No such file or directory

I keep getting the same error in my log files> [01-Aug-2015 22:27:16 Europe/London] PHP Warning: mysqli_connect(): (HY000/2002): No such file or directory in /homepages/20/d503465712/htdocs/shops/mainshop/includes/classes/db/mysql/query_factory.php on line 62 Line 62```
$this->link = mysqli_connect($zf_host, $zf_user, $zf_password);


Is there a way of putting a back trace on to find out what is causing the problem?

Learning Fast.
Eden Craft Supplies

1 Aug 2015, 10:06 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: mysqli_connect(): (HY000/2002): No such file or directory

Is the store working fine otherwise? Or is the site completely down?

If the site is completely down, then the problem is likely that your hosting company's MySQL connection is unreliable, and perhaps its configuration is set to use a 'socket' which is not functioning properly.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

1 Aug 2015, 11:19 PM
#3
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

DrByte:

Is the store working fine otherwise? Or is the site completely down?

If the site is completely down, then the problem is likely that your hosting company's MySQL connection is unreliable, and perhaps its configuration is set to use a 'socket' which is not functioning properly.

As far as I can work out everything else is fine.

Learning Fast.
Eden Craft Supplies

2 Aug 2015, 6:06 AM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: mysqli_connect(): (HY000/2002): No such file or directory

adb34:

I keep getting the same error in my log files Line 62```
$this->link = mysqli_connect($zf_host, $zf_user, $zf_password);

> 
> Is there a way of putting a back trace on to find out what is causing the problem?

Don't know if it will provide any more useful information, but there is lat9's mydebug backtrace plugin that might offer somethng...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

2 Aug 2015, 9:31 AM
#5
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

mc12345678:

Don't know if it will provide any more useful information, but there is lat9's mydebug backtrace plugin that might offer somethng...
I have downloaded the plugin by Lat9 and will give it a go.

To who ever changed the subject: Thanks I could not think of a subject title. I sat for 5 mins thinking of one.

Learning Fast.
Eden Craft Supplies

2 Aug 2015, 10:06 AM
#6
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

I have installed the plugin and have the following;> [02-Aug-2015 11:01:55 Europe/London] #1 mysqli_connect() called at [/homepages/20/d503465712/htdocs/shops/mainshop/includes/classes/db/mysql/query_factory.php:62]

#2 queryFactory->connect() called at [/homepages/20/d503465712/htdocs/shops/mainshop/includes/classes/class.phpbb.php:32]
#3 phpBB->phpBB() called at [/homepages/20/d503465712/htdocs/shops/mainshop/includes/autoload_func.php:79]
#4 require(/homepages/20/d503465712/htdocs/shops/mainshop/includes/autoload_func.php) called at [/homepages/20/d503465712/htdocs/shops/mainshop/includes/application_top.php:158]
#5 require(/homepages/20/d503465712/htdocs/shops/mainshop/includes/application_top.php) called at [/homepages/20/d503465712/htdocs/shops/mainshop/index.php:26]

Learning Fast.
Eden Craft Supplies

2 Aug 2015, 12:16 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,118
Plugin Contributions:
56

Re: mysqli_connect(): (HY000/2002): No such file or directory

Check the value in Configuration->My Store->Enable phpBB linkage? ... if you're not associating a phpBB forum with your site, this value should be set to false.

Did you do a fresh install or upgrade an existing site?

2 Aug 2015, 12:59 PM
#8
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

lat9:

Did you do a fresh install or upgrade an existing site?
It was an upgrade over v1.5.3 with no changes prior to the upgrade. I have changed the status of Enable phpBB linkage? to False.

Learning Fast.
Eden Craft Supplies

2 Aug 2015, 2:44 PM
#9
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

lat9:

Check the value in Configuration->My Store->Enable phpBB linkage? ... if you're not associating a phpBB forum with your site, this value should be set to false.
The problem was being generated by the link being set to 'True'. Might be worth the while to put this somewhere for others to find, possibility with the FAQs?

Learning Fast.
Eden Craft Supplies

2 Aug 2015, 8:10 PM
#10
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,118
Plugin Contributions:
56

Re: mysqli_connect(): (HY000/2002): No such file or directory

Right, the reason I asked initially is that yours is not the first report of that phpBB-related configuration setting *magically *getting set to "true" on the upgrade. I'm not a big fan of magic.

3 Aug 2015, 9:25 AM
#11
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

lat9:

Right, the reason I asked initially is that yours is not the first report of that phpBB-related configuration setting *magically *getting set to "true" on the upgrade. I'm not a big fan of magic.

I am not a big fan 'magic' setting, great to be able to find the problem. It was just generating a lot of 2k files. After 10,000 2k files in one day, it gets a bit hard to find other faults. Your debug plugin cracked it though. Without it I would still be chasing my tail. Thank you lat9 (and all other contributor's to the plugin's :smile:).

Learning Fast.
Eden Craft Supplies

3 Aug 2015, 4:06 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: mysqli_connect(): (HY000/2002): No such file or directory

Particularly peculiar, since there's nothing in the upgrade that does anything to set that value to true.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Aug 2015, 4:12 PM
#13
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

DrByte:

Particularly peculiar, since there's nothing in the upgrade that does anything to set that value to true.
I actually think it was changed by a plugin that I uploaded. All sorted now.

Learning Fast.
Eden Craft Supplies

14 Aug 2020, 3:07 PM
#14
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

adb34:

I actually think it was changed by a plugin that I uploaded. All sorted now.

Yet here we are in 2020 and I am getting the same error in logs.

V156.C

ZC v1.5.7 "I was so much older then...I'm younger than that now" Cut the umbilical cord with webhosts after 20 years. FREEDOM!

14 Aug 2020, 9:43 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: mysqli_connect(): (HY000/2002): No such file or directory

pixelpadre:

adb34:

I actually think it was changed by a plugin that I uploaded. All sorted now.Yet here we are in 2020 and I am getting the same error in logs.

V156.C
Your sarcasm screams loudly, and is completely unnecessary.

Regardless what year we're in, the underlying cause is still the same: something wrong with the database connection. Nothing in Zen Cart can fix your database or the configuration details you've told it to use.
Also, you've given zero information about your specific situation to allow us to respond with anything helpful, so unfortunately there's not much one can give as a useful reply.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Aug 2020, 12:05 PM
#16
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

DrByte:

Your sarcasm screams loudly, and is completely unnecessary.

Regardless what year we're in, the underlying cause is still the same: something wrong with the database connection. Nothing in Zen Cart can fix your database or the configuration details you've told it to use.
Also, you've given zero information about your specific situation to allow us to respond with anything helpful, so unfortunately there's not much one can give as a useful reply.

Now there's the DrByte that I remember! Welcome Back.

I wish I had more info, but I don't. It appeared, like for the others, in the logs directory. Been there a long time. Last occurence was July 29. I didnt see any entries in the myql logs to coorelate. I deleted the logs files. There was only one offending ip. It was a new bot on the scene. Started with an S as I recall. And it only happened on the last (7) page of All Products according to the url in the debug file. I dont have the debug file because I emptied the directory. Since then, no entries.

ZC v1.5.7 "I was so much older then...I'm younger than that now" Cut the umbilical cord with webhosts after 20 years. FREEDOM!

15 Aug 2020, 4:00 PM
#17
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,858
Plugin Contributions:
18

Re: mysqli_connect(): (HY000/2002): No such file or directory

I was going to suggest that you check with your host to see if any settings had changed, but....:smartalec:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

15 Aug 2020, 7:13 PM
#18
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

dbltoe:

I was going to suggest that you check with your host to see if any settings had changed, but....:smartalec:

I've been running a linode vps (Centos 7 dist.) for several years, seems like maybe 5 years now. (Centos 6 originally)

ZC v1.5.7 "I was so much older then...I'm younger than that now" Cut the umbilical cord with webhosts after 20 years. FREEDOM!

15 Aug 2020, 9:08 PM
#19
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,858
Plugin Contributions:
18

Re: mysqli_connect(): (HY000/2002): No such file or directory

Centos 7 was a 2003 release :shocking:

And, not supported any longer. (EOL 7 April 2020)

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

16 Aug 2020, 12:40 AM
#20
pixelpadre avatar

pixelpadre

Suspended

Join Date:
Jun 2007
Location:
Eustis, Florida, USA, EARTH
Posts:
868
Plugin Contributions:
0

Re: mysqli_connect(): (HY000/2002): No such file or directory

dbltoe:

Centos 7 was a 2003 release :shocking:

And, not supported any longer. (EOL 7 April 2020)

How many people were running centos 7 in 2007? Was it 2 or 3? I dont remember.

Yes, Centos 7 is no longer supported. But it is widely used. I would bet any money, that there are more using centos 7 than using centos 8. Care to wager? Centos 8 brings a lot of changes and headaches to administrators. https://wiki.centos.org/About/Building_8

Having said that, I will most likely switch to 8 early next year.

The bot I was referring to earlier is/was semrush.com

I'm not getting any more error messages at all now. And that is equally concerning to me.

ZC v1.5.7 "I was so much older then...I'm younger than that now" Cut the umbilical cord with webhosts after 20 years. FREEDOM!