Posted in code
24
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
55
This Month
136
This Year
3307

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
Be Yourself, Back Yourself
Kristie Bennett, Survivor
Random CSS Property

border-block-end-width

The border-block-end-width CSS property defines the width of the logical block-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-width, border-right-width, border-bottom-width, or border-left-width property depending on the values defined for writing-mode, direction, and text-orientation.
border-block-end-width css reference