Monthly Archives: January 2014


Back into Audio Books

audible logoSo, after getting out of reading (and not even listening to books in a few years, I finally broke down and loaded up the Ender’s Game audio book to listen while sitting in traffic. I forgot how nice it is to listen to when sitting in traffic. Makes commuting so much better with 90% less suck (especially if you enjoy the book).

There were a couple of reasons why Ender’s Game. 1) Wanted to hear it again before seeing the movie (even though Orson Scott Card has rewritten the last chapter since my version of the audio book was recorded). 2) I enjoyed it a lot the first time I heard it. 3) Orson Scott Card is a play-write author. What I mean is that when he writes he writes so that his stories are told not read. He has said during an interview that he loves when he hears “I remember when my mom/dad read Ender’s Game to me”. He also used a dozen other examples and reasons as to why he likes having his stories told and not read. So, in remembrance of this last bullet I listened to it again.

If you have never read/heard Ender’s Game, know one thing; you immediately need to start reading the next book (Speaker For The Dead), followed by the next (Xenocide), etc.

Soapbox: follow Orson Scott Card’s reasoning and listen to his books. I have partially read Ender’s Game (actual reading, not listening) and found the presentation MUCH better when listening to it. There is something about his way of writing that makes his stories better told vs. read.

To help get my crave of space adventure, while idling in traffic, and for better sound (shhh, I previously downloaded all these books….) I broke down and joined audible with their 30-day free trial. Signing up was easy, and getting my free book was just as easy. Quickly downloaded the app to my phone and downloaded the book. You can even download these audio books to your any of your Kindles and it uses whisper sync to sync your location across all devices (huge plus!),

The app itself is nice and simple and reminds me a little of the Amazon Kindle app (as it should!). You can easily get to whatever chapter you need to, backup, pause, all the normal stuff.

If you are a big book reader, but just cannot find the time, I have to say, GET AUDIBLE! I have been listening to books driving, walking and when doing some light work at work. I upgraded one level on my subscription, so I pay $23/month. With this subscription I get two book credits each both to download books. So doing the math, each audio book comes out to $11.50 which is about a $9 savings when you look at the full price of the audio book.

It may just save your sanity when you are stuck in traffic at 5pm on a Friday afternoon.

Hmmm… I seem to have rambled… all well.


Correct Database Issue #144 – Corrupted Table

I came across an interesting problem recently where one of my MySQL tables became corrupted and the automated repair feature was not able to fix it. It was a non-critical table so the website still mostly functioned, but it did limit some functionality. I had a backup, but it was a few days old and I had just recently made a lot of changes that impacted that particular table. So after searching for a hour I was finally able to find the issue and resolve it without needing root access to the server (which I don’t have).

Note: there are a number of reasons a MySQL table can become corrupted and I have not yet diagnosed what caused the issue for me. It could be anything from a hard disk failure to a software issue.

Background

  • I host everything with bluehost.com
  • I have shell access, but do not have root access – IMPORTANT
  • I have full access to phpMyAdmin and the MySQL Databases

The Error

Here is the error I was seeing in phpMyAdmin (sanitized of course)

#144 - Table './<database>/<tablename>' is marked as crashed and last (automatic?) repair failed

Nice cryptic error.

The Resolution

I logged into the shell interface using putty and logged into the database:

$ mysql -u <username> -p

Replace <username> with your database username. After pressing enter it will prompt you for your password.  After logging into MySQL we need to select the database that contains the corrupted table:

mysql> use <database>

Again, replace <database> with the name of the database.  You should see a confirmation message of “Database changed”.  Now let’s check the table that is causing the issue:

mysql> check table <tablename>;

As before, replace <tablename> with the name of the suspected table.  You should get output similar to:

+--------------------------------------+-------+----------+---------------------------------------------------+
| Table                                | Op    | Msg_type | Msg_text                                          |
+--------------------------------------+-------+----------+---------------------------------------------------+
| database.tablename                   | check | warning  | Table is marked as crashed and last repair failed |
| database.tablename                   | check | warning  | Size of datafile is: 20652 Should be: 19564       |
| database.tablename                   | check | error    | Key in wrong position at page 14336               |
| database.tablename                   | check | error    | Corrupt                                           |
+--------------------------------------+-------+----------+---------------------------------------------------+
4 rows in set (0.02 sec)

This is definitely the problem table. Now to run the command repair command:

mysql> repair table <tablename>;

You should get output similar to:

+--------------------------------------+--------+----------+----------------------------------------------------+
| Table                                | Op     | Msg_type | Msg_text                                           |
+--------------------------------------+--------+----------+----------------------------------------------------+
| database.tablename                   | repair | info     | Delete link points outside datafile at 18580       |
| database.tablename                   | repair | info     | Found block that points outside data file at 18908 |
| database.tablename                   | repair | info     | Found block that points outside data file at 18924 |
| database.tablename                   | repair | info     | Found block that points outside data file at 19064 |
| database.tablename                   | repair | info     | Delete link points outside datafile at 20152       |
| database.tablename                   | repair | status   | OK                                                 |
+--------------------------------------+--------+----------+----------------------------------------------------+
6 rows in set (0.00 sec)

Looks like everything is resolved, but run the check command again to verify. You should get something similar to:

+--------------------------------------+-------+----------+----------+
| Table                                | Op    | Msg_type | Msg_text |
+--------------------------------------+-------+----------+----------+
| database.tablename                   | check | status   | OK       |
+--------------------------------------+-------+----------+----------+
1 row in set (0.01 sec)

And that is it. I logged back into phpMyAdmin and everything seems to be working like a charm. All-in-all a scary error that was easy to fix.