« Transformations | Main | Iterating through directories in bash »

Movable Type with multiple MySQL installations

Yes, this site has been up and down like the groom's backside on wedding night over the last couple of days.

My host installed MySQL5 alongside the existing MySQL4 and recommended everyone move their databases over. That part of the process was easy, but getting Movable Type to point at the new database was a bit of a challenge. The solution, in the end, was simple, so I hope this information helps others.

Because both database engines are running on the same host as the server, a "Socket" setting is used to differentiate them. Specifically, we have:

MySQL4 - Host: localhost, Socket: /tmp/mysql.sock
MySQL5 - Host: localhost, Socket: /tmp/mysql5.sock

Apparently, many web applications accept a SQL host string in the format localhost:/tmp/mysql5.sock, but to my eyes this is a syntax clash, since one could reasonably specify a SQL host running on port 6666 as localhost:6666. Indeed, it seems different parts of Movable Type accept different syntaxes.

The problem in particular, is that mt.cgi (on the admin side) will happily use a DBHost, DBPort and DBSocket setting, ezsql (on the client side) will not. After significant investigation (ie. lots of trial and error), I found these in mt-config.cgi settings to work:

### MySQL Configuration - Add the name of your database, username
# password and, optionally database host given to you by your web 
# hosting provider.
#
ObjectDriver DBI::mysql
Database database_name
DBUser username
DBPassword password
DBHost localhost:/tmp/mysql5.sock
DBSocket /tmp/mysql5.sock

TrackBack

TrackBack URL for this entry:
http://heath.hrsoftworks.net/cgi-bin/mt-tracker.cgi/170

Post a comment