cpanel broke mysqlhotcopy 1.22 but here is a fix!

mysql-logo.gif
Yesterday I logged into my server to back up my databases. I back up the mysql databases using a tool called “mysqlhotcoy”. It’s a handy perl application that copies the database files for easy restores, and it also works really quick when you run it.

I ran the mysqlhotcopy command as root, and was greeted with an error similar to this:
Invalid db.table name 'foo.foo`.`bar'

um, no…. this table exists

I have cpanel installed on my server, a lot of server do. cpanel does updates to many application, mysqlhotcopy is one of them. It looks like my version of mysqlhotcopy was updated to 1.22, and there is some major problems with mysqlhotcopy 1.22.

I did some googeling and I found some people talking about the problem. I even found a quick patch for the problem. The problem comes from a host adding the username and an underscore before a database name (example: “username_databasename.table“). mysqlhotcopy only looks for databasename.table

The following patch instructions will fix mysqlhotcopy 1.22

  • Open the perl script for editing. It is located at /usr/bin/mysqlhotcopy
  • find the following subroutine

    sub get_list_of_tables {
    my ( $db ) = @_;

    my $dbh = DBI->connect(“dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy”,
    $opt{user}, $opt{password},
    {
    RaiseError => 1,
    PrintError => 0,
    AutoCommit => 1,
    });

    my @dbh_tables = eval { $dbh->tables() };
    $dbh->disconnect();
    return @dbh_tables;
    }

  • look for this line (mine was link 821):

    my @dbh_tables = eval { $dbh->tables() };

  • immediately after that line add the following:

    map { s/^.*?\.//o } @dbh_tables

Here is my patched subroutine:

sub get_list_of_tables {
my ( $db ) = @_;

my $dbh = DBI->connect(“dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy”,
$opt{user}, $opt{password},
{
RaiseError => 1,
PrintError => 0,
AutoCommit => 1,
});

my @dbh_tables = eval { $dbh->tables() };
map { s/^.*?\.//o } @dbh_tables;
$dbh->disconnect();
return @dbh_tables;
}

After I applied the patch, everything was back to working order.

Some people have other approaches that would work also, like downgrading mysqlhotcopy all together.

Personally, I think adding one line of code wasn’t that big of a deal to fix the program

iSold out and got a iPhone

iphonesmall.jpg
For over a year and a half, I have used a windows mobile 5 based phone, the T-Mobile MDA (which is actually a re branded HTC Wizard). The MDA was such a great phone that I created a website for modifying and customizing it, MDATweak.com

I liked the fact that I could add 3rd part applications to it, like pocket putty (an ssh client), and the web browser was the best mobile browser on the market. I also liked the fact that I could sync my contacts and calender from outlook to the phone,

When the iPhone was announced, I was super excited about it. I was in a contract with T-Mobile, and was happy with with my MDA. I didn’t want to wait in the lines, and more importantly I didn’t want to pay the price tag for the iPhone.

Last week I was talking with my friends Bill Garoutte in my office, going over my list of reasons why I was not going to get an iPhone. As I was talking to him about how I liked my MDA phone, I managed to knock it off my desk. I have dropped my phone tons of times in the past. Its always been ok. This time was not one of those times… I was charging my phone through the USB connection on the bottom of the phone. The phone must fallen perfectly because the USB cable popped out. I picked the phone up and plugged the USB cord back in. The USB jack on the phone pushed up and into the phone.

The USB jack broke off the board inside the phone and was free floating inside the device! The phone still worked but without the USB jack to charge the phone, in a few days, my MDA would become a giant paper weight.

I called T-mobile, and they told me it would be almost $200 to replace my aging MDA phone. It was $300 to move up to the newer version of the MDA, the T-mobile Wing. Looking at the options, I was going to have to shell out some cash to get another phone, and I only had a day or 2 to figure it out before my phone was going to die. I talked to T-mobile about my situation, and the lady I dealt with was not nice to me at all, and wasn’t willing to work with me on figuring out a solution to get an upgraded phone without renewing my contract with T-mobile. I was so frustrated by the experience I decided to bite the bullet and move over to AT&T and get an iPhone.

I placed an order for two iPhones (the wife wanted on also) on July 3rd, and I received them in Saturday July 7th. So here I am with two new iPhones. I will post later with what I think about them once we have really started using them.

4th of july fun : modified sparklers

circa 1999

If you looked through my permanent record, you would see that in the past my friends and I have been known to do dangerous things with fireworks.

When it comes to safe fireworks, sparklers are cool until you learn how to make the other fireworks explode. This year I found out how to make sparklers cool again by making them explode!

I guess you take a bundle of sparklers, wrap them all in electrical tape really tightly, leave one out for a fuse. light and run. amazing! This is for sure something that I’m going to add to my bag of tricks!

Here is the video on how it all works:
http://www.metacafe.com/watch/697373/more_bang_for_your_buck/

my new (used) laptop

toshiba_satellite_a100_le4.jpg
Over the last weekend, I overhauled a “broken” laptop that I got of craigs list for a steal. Its a Toshiba m55. 1.6 ghz pentium M, 1 gig of ram, wide 15in glossy screen, 2 batteries, charger, needed a hard drive, $200… stoked! (I replaced the hard drive with a 120 gig western digital)

I’ve been wanting a laptop more and more recently because I feel like I could be getting things when I am away from the notPop Labs (aka my computer room). I end up spending a lot of time on my cell phone (t-mobile mda … http://www.mdaTweak.com), but never really getting anything accomplished. Now I can use my phone as a cellular modem, and use my laptop to get some work done.

I think having a decent laptop also opens me up to the world of coffee shops. I always seemed to do my best school work in a coffee shop, lets see if that holds true when it comes to working on my personal websites.

Look out world, Josh Highland is computing wirelessly now again (this is my 4th laptop in 10 years)!

update: On top of getting the laptop for a great price, my friend Luis Majano just hooked me up with a super sweet laptop bag for it. woo woo!