Technical information on this site may be out of date : no updates since 2015
Ubuntu Mysql Root password reset (init file not found)
If you don’t use the mysql root account very often and change passwords reasonably frequently you may (like me) find that you no longer know the mysql root password on a dev box.
The mysql site has a reasonable guide here https://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix
But there always seems to be something additional, this time for me it was apparmor preventing mysql from reading my reset file
MySQL AUTO_INCREMENT updates
I just found out the painful way that if you manually update a column which is normally calculated automatically as an auto_increment it seems to work at first ..
but MySQL doesn’t update the auto_increment value for the table - so subsequent inserts can fail.
SQL Greatest and Least
Most of the time I can get what I want out of SQL using the standard aggregate functions, but today I needed to find the latest timestamp from any one of three columns.
I achieved this using the GREATEST() function, it’s not part of the SQL standard but is commonly available.
Adding more data types to schema API for Drupal 7
I’ve written a patch for Drupal 7 to enable date and time data types to be defined for the schema API.
Update : it got removed
For most of 2008 I’ve been working on a large Drupal installation (around 10 developers, something like 100 custom modules, 17 languages, split over 2 sites).
This all adds up to a lot of updates, and schema changes.
MySQL restore is very slow
It seems there is a bug in MySQL which is causing restores to run very slowly (hours instead of minutes)
The bug is fixed in http://dev.mysql.com/doc/refman/5.0/en/releasenotes-cs-5-0-67.html
But Ubuntu hasn’t updated yet….
Adding comments to the database
Comments in code are widely used and generally (but not universally) accepted as a good thing.
Databases can also accommodate comments - but these seem to be very rarely used.
I’m of the opinion that database comments are very useful.