Posted in code
436
2:40 am, March 1, 2025
 

Forgotten MYSQL Connection Crashing Site ANNOYING!

So i had noticed that this site was crashing for the past few days, and i knew that is was a mysql issue. But this site does not run on MYSQL so WTF!

I removed some random tables that had some search data in them and other random things, but it was still getting cained by some stupid bots or something.

If i stopped the mysql service it would fix the server, but this site would give the message.

Connection failed: No such file or directory

I knew this sounded like some kinda random mysql error, but this site does not use MYSQL does it? I had not updated the source on here since years ago, but its usually running fine.

It loads all the class extends on each page load even if it does not use the data so i guessed i must have added a mysql connection and forgotten about it.

But within the hundreds of files how do i locate the connection, as if i disable the mysql service the whole site just shows the connection failed message. 

Apparently VSCODE has a search function where you can search for a string across all your files, nice!

So all I had to do i find what the connection string was and then it would point me to the file. 

I searched for the generic stuff, mysql, sql, and there were hundreds of refs and then i searched for 

"new mysqli"

You can do this in VS Code with CTRL + SHIFT + F just make sure you have the exact target site loaded when doing this or it will show everything on the server. 

And it found the code! Apparently i had a mysql connection on a words class extend that i had forgotten about, i dont think it was even being used anymore, but it loaded the class and connected to the database and for some reason this was crashing the site and server. I think there may have been a page i added to search the words or give random words or soemthing it is basically a full dictionary of all english language words and the word types or soemthing and it has a thesauras on there as well with the meanings so i guess the AI bots were calling this over and over and crashing my tiny little server, lol...

I was going to convert this site totally to just JSON data and load them all from flat files, but the sqlite seems to be running nicely still.

So i diabled that class extend from loading and the site is running fine now. Yay... 

View Statistics
This Week
235
This Month
453
This Year
453

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Articles
Search Articles by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
When I realized that, no individual step is hard in any process. Building this airport I'm standing in right now started with a guy writing the architectural plans on paper. That's not hard for him to do. Then laying the first beam isn't had. The whole thing is really hard. So, just take each step kind of piece by piece and when I was able to do that and stop trying to chase this prize and started putting in the work, things just started coming together.
Unknown
Random CSS Property

::first-letter (:first-letter)

The ::first-letter CSS pseudo-element applies styles to the first letter of the first line of a block-level element, but only when not preceded by other content (such as images or inline tables).
::first-letter (:first-letter) css reference