Archives For Database

Import Large SQL Files

September 30, 2011 — Leave a comment

I’ve been in the process of server migration over the past few days. It’s been easy and I’ve experienced no down time thanks to Cloudflare and the fact that DNS propagation takes a while.

One of the hardest parts of migration wasn’t the site files, it was the databases! I had exported all of the databases into 1 SQL file via phpMyAdmin, but it was too large for phpMyAdmin to import so I had to find a way to get everything back where it belonged! Thankfully, MySQL makes this simpler than I’d imagined.

To import a SQL file:

  1. Login to the server via SSH
  2. Login to mysql with: mysql -u USER -p'PASSWORD'where USER is your MySQL user and PASSWORD is your MySQL password.
  3. Type: source FILENAME.SQL where FILENAME.SQL is the path to the SQL file you wish to import
  4. Hit enter, and watch it import!

Give Your Blog a Workout

November 16, 2010 — 1 Comment

After watching the Tumblr v 4Chan battle, it made me wonder how much my server could handle if put under enough stress.

The question, though, was how much stress?

Using the same tool that was used during Tumblr v. 4Chan, I attempted to DDOS my own server.

To be clear, a denial of service attack attempts to overload the server with network requests. So many, in fact, that it can’t keep up. Usually this causes web pages to time out and it can really freak out a database!

Continue Reading…

Optimizing the Database

October 25, 2010 — 1 Comment

Optimizing your database is an increasingly popular way to speed up your blog. The concept is really simple: over time, your

database becomes overburdened with requests and thus creates overhead to compensate. The more a table is accessed, the more likely it is to have overhead. It’s the same way a hard drag fragments itself.

The optimize process is the equivalent to de-fragging your hard drive.

Here’s how you can check for overhead, and get rid of it!
Continue Reading…