Posted in code
984
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
40
This Month
137
This Year
4267

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...

You could also follow me on twitter. I have a couple of youtube channels if you want to see some video related content. RuneScape 3, Minecraft and also a coding channel here Web Dev.

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
In this case my anchor this week becomes driving almost 2hrs outside of Atlanta to one of my favorite hard core gyms in the world.. MetroFlex aka The Dungeon. The gym owners turn the heat way up so it becomes a fun sweat box and the gym members just watch from afar and leave me alone. I happily drive myself long distances to find MY ANCHOR. Our anchor allows us to have balance, focus and be as productive as possible. And if you're in the middle of a heavy set and your headphones start to fall off your head, like mine did here.. well.. f*ck the headphones. Let em break and fall. You can always get a new pair, but the iron ain't ever gonna lift itself.
Unknown
Random CSS Property

counter()

The counter() CSS function returns a string representing the current value of the named counter, if there is one. It is generally used in the content property of pseudo-elements, but can theoretically be used anywhere a <string> value is supported.
<counter> css reference