Category Archives: MySQL

Scripts, queries, gotchas and more about MySQL databases

Tune MySQL like a pro with MySQLTuner

I don’t know why I didn’t know about this before (or why I forgot about it, more likely), but I came across MySQLTuner recently and was most pleasantly surprised. It’s a Perl script that only requires your MySQL user and … Continue reading

Posted in MySQL | Tagged , , , | Leave a comment

Better access to MySQL create view statements

I’ve found that I often create several views that are variations on an initial one, providing a slightly different convenient slice of the data as the need arises. But when a view is created the syntax actually stored can be … Continue reading

Posted in MySQL | Tagged | 2 Comments

Advanced ordering of MySQL results

MySQL’s “order by” keyword allows the order in which result rows are returned to be defined. This is quite useful in a wide variety of circumstances. You can specify any number of columns whose values you want to order the … Continue reading

Posted in MySQL | Tagged , | Leave a comment

Rapidly set up a MySQL database for testing

Sometimes you just want a database to run some queries against. Any reasonable set of tables with data pertaining to something not terribly complicated will do. Perhaps you have an urge to tease out the intricacies of correlated subqueries, or … Continue reading

Posted in MySQL | Tagged , , | 2 Comments

Troubleshooting with MySQL binary logs

MySQL replication has a wide range of uses, including debugging applications writing to the DB being replicated. Once set up, all statements “that update data or potentially could have updated it” are stored in one or more binary logs (MySQL … Continue reading

Posted in MySQL | Tagged , , | Leave a comment