PHP Script for MySQL Optimization and Backup

June 6th, 2009 Chris K No comments

phpmysqlThe biggest complaint I hear from people who use MySQL driven sites on inexpensive shared hosting services is a decrease in performance over time. Most of the time this decrease is no fault of your hosting provider, but the cluttering of your database.

Like any computer storage device, a database is simply a collection of data that through time, use, and abuse can grow unorganized and cluttered. I uncovered a few scripts people had written in this article at noupe.com. Not only did I want to have my databases optimized, I also wanted the backups to be created. So what I have in for your enjoyment is a script that will optimize your database, backup the database to a file including the timestamp (to avoid overwriting), and it will also email you upon warnings and errors.

To install this script you place it in a folder that you can call something like ’supersecretfoldername’ and put a password on this folder. When the script is run it places a backup in a folder named ‘_db_backups’ in the directory parent to the ’supersecretfoldername’ folder.

As a bonus, if you use this in conjunction with GoDaddy hosting services, you can use this as a Cron Script to be run without your interaction and the backups will be in GoDaddy’s default database backup folder. GoDaddy’s Hosting Control Center will also email you the script results as part of their Cron Manager interface.

Download the script.

If you are using GoDaddy you will want to set the file permissions to ‘Executable’ through their ‘File Manager’ (Help Article). You can then use the ‘Cron Manager’ from within the ‘Content’ section of your Hosting Control Center. Here you can set the email address they will send your results to, your scripts, and their frequency

Categories: Development Tags: , ,

Someone in my family is famous!

May 14th, 2009 Chris K No comments

uncledavidOn May 12th, Mens Journal wrote an article about a man of pure genius. This man has improved upon a dish called “The Bacon Explosion“. This man, happens to be MY UNCLE! Check out the story over at Men’s Journal (full story).

Some great Uncle David quotes are in the article and my favorite part of the article follows:

He’s even gone so far as to make a bacon explosion stuffed with fried onion rings. “That was pretty badass,” admits Conn, who improbably is a former music professor at Cornell University.

So here’s to you Uncle David. Congrats! You and Uncle Steve are the ones I have to credit with the bulk of Kitchen Chops that I have acquired while being your assistant through all those Thanksgiving and Christmas dinners.

Categories: Food, Updates Tags: , , ,

Still don’t get this Twitter thing?

May 8th, 2009 Chris K No comments

Most of us get the whole Twitter idea. Some, still can’t grasp it. This week Bob Parsons, CEO of GoDaddy.com, put a video up on his blog explaining Twitter is possibly the most simple way. Check it out below. When you are done watching, head over to bobparsons.me for more videos and blog posts from Bob.

When you are done, go ahead and follow me on twitter @cklosowski.

Video after the break. Read more…

Categories: Media, Twitter Tags: , ,