Category Archives: MySQL

Production MySQL performance tuning

For the past 9 years I’ve been working almost exclusively with MySQL (with a little PostgreSQL thrown in) and while I don’t do nearly as much DBA work these days, I still find myself troubleshooting a query or tuning my.cnf. … Continue reading

Posted in Database, FreeBSD, Linux, MySQL, Systems Administration | Leave a comment

Standalone Migrations: Using Rails migrations in non Rails projects

Update 8/7/2010: Standalone migrations is now a gem (sudo gem install standalone_migrations) so disregard the outdated installation instructions below Update 7/8/2009: With the latest batch of contributed patches standalone migrations now works just like Rails migrations Update 12/26/2008: I switched … Continue reading

Posted in Database, Java, Linux, MySQL, Ruby, Ruby on Rails | 5 Comments

Comparing Amazon EC2 with VPS and dedicated hosting

I’ve been reading all the great things about Amazon EC2 (or Elastic Compute Cloud) and lots of pricing comparisons with VPS and dedicated hosting. I finally got an EC2 account and tinkered a bit and there’s a big difference between … Continue reading

Posted in Database, FreeBSD, Linux, MySQL, Systems Administration | 9 Comments

SQL statements mysteriously not replicating with MySQL replication

If you’re using MySQL replication there’s a feature/bug that you should be aware of. The following SQL statement would not replicate to the slave servers:

Posted in Database, MySQL | 2 Comments

MySQL ODBC Driver issues and Excel

Caveat: this post is probably only of interest if you’re running into this particular MySQL ODBC Driver problem. Hopefully other people running into this issue will find this useful or please add a comment if you find a better way! … Continue reading

Posted in Desktop, MySQL | 2 Comments

Configuring MySQL sql-mode in Ruby on Rails

In my previous post I wrote about setting MySQL to a stricter sql-mode to make it behave like most other databases, however, I recently ran into a case where I couldn’t set the global sql-mode without breaking some legacy applications. … Continue reading

Posted in MySQL, Ruby, Software Engineering | 1 Comment

When installing MySQL always set the sql-mode

As I’ve described before, MySQL has some appalling out of the box settings which will thwart your attempts at good data integrity! They’ve clearly seen the light though and at least give you an option to achieve good data integrity … Continue reading

Posted in MySQL, Systems Administration | 1 Comment

Creating database test fixtures and the rails export fixtures plugin

Being able to quickly and easily create test fixtures for your database is important yet it’s not always easy. There are basically 3 approaches I’ve seen used: 1. Use a MySQL or PostgreSQL dump that gets imported before the tests … Continue reading

Posted in Database, Java, MySQL, Ruby, Software Engineering | 3 Comments

Moving MySQL tables live with zero downtime

The biggest challege to moving large amounts of data into production with (almost) zero downtime with MySQL is that the old table will be dropped and the new table locked while you’re loading the data. If you try that while … Continue reading

Posted in Database, MySQL, Systems Administration | 2 Comments