kieranbarnes these are the things i learnt today

Getting mytop to work on CentOS/Redhat

Posted on July 9, 2009

Screw all these AJAXified, buzz-wordified MySQL monitors. I'm old school. I use the fantastic mytop tool Jeremy Zawodny created 9 years ago.

Unfortunately it won't run on CentOS. I got the error, 'Error in option spec: "long|!"'

Filed under: Linux, MySQL Continue reading

SQLyog Query Profiler

Posted on February 10, 2009

MySQL has always lacked the sophisticated profiling tools shipped with proprietary databases like SQL Server, etc. MySQL developers have largely depended on EXPLAIN for tuning queries. The SHOW PROFILE patch by Jeremy Cole was introduced in the MySQL Community version 5.0.37 and it provided much more insight into where the query spends its time. However, to take advantage of this feature, MySQL developers were supposed to switch on profiling, run their queries and then filter the profiling data from a table that contained the profiling results of the last few profiled queries. A lot of manual book-keeping is required to take advantage of this powerful feature. In an ideal situation, the MySQL developer should execute the queries and the profiling info should be available along with the result-set. Unfortunately, none of the MySQL client tools (desktop or web-based) provide intrinsic support for this feature.

Watch the Screencast on Query Profiler.

I♥MySQL

Filed under: MySQL, Windows No Comments

Convert phpBB IP Addresses

Posted on October 9, 2008

phpBB stores its IP addresses in a funky format. They're useless to the human eye!

Convert them to normal IPs with the following code

SELECT CONCAT( CONV( substring( poster_ip, 1, 2 ) , 16, 10 ) , '.', CONV( substring( poster_ip, 3, 2 ) , 16, 10 ) , '.', CONV( substring( poster_ip, 5, 2 ) , 16, 10 ) , '.', CONV( substring( poster_ip, 7, 2 ) , 16, 10 ) ) AS IP
FROM phpbb_posts
WHERE `poster_id` = USERID
LIMIT 0 , 30 

This code will convert all know IPs from a selected user (In my case 51).

Filed under: MySQL, PHP 5 Comments

Retro Fitting Record Pagination with ADOdb

Posted on January 2, 2008

For my first project of the New Year I had to retro-fit pagination controls to an existing ADOdb powered web application for a client of mine. Looking back at my previous post on this topic, it was relatively simple to add the required features. Hers's how I did it.

Filed under: MySQL, PHP Continue reading

Yahoo Term Extractor

Posted on August 1, 2007

A recent project I was working on cause me to stumble over the Yahoo Term Extractor. Something I had previously never heard of - it is a very underrated tool.

The Term Extraction Web Service provides a list of significant words or phrases extracted from a larger content.

Reset MySQL password on Ubuntu in about 1 second*

Posted on July 17, 2007

* It may take a little longer depending on your server and finger speeds!

dpkg-reconfigure mysql-server-5.0

Filed under: Linux, MySQL 5 Comments

MySQL Tuning Server Parameters

Posted on July 13, 2007

These are some of the handy MySQL 5.0 tweaks I do to get the most out a MySQL database;
I adjust the following to suit my server, I try to give MySQL as much resource as possible.

Filed under: Linux, MySQL Continue reading