Oh, as an Aside: Can’t connect to local MySQL server through socket…error. (From the 21st of September)

I recently moved my /home folder to its own partition, but in doing so, I broke MySQL. The full error I got was:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

To fix this you need to create the file and make sure that MySQL has access to it. (All commands need to be run as root)

Create the directory (if it doesn’t already exist).

sudo mkdir /var/run/mysqld/

Create the file by “touching” it.

sudo touch /var/run/mysqld/mysqld.sock

Set the ownership of the mysqld.sock file and folder to mysql.

sudo chown -R mysql /var/run/mysqld/

You can then start MySQL and breath easier.

Oh, as an Aside: Mysql Search and Replace. (From the 31st of August)

I’ve been getting ready for Wordpress 2.3, so in preparation I’ve started cleaning up my database. My first order of business was to clean up the tags database. Over time I’ve used several different methods of separating words: all spaces, hyphens and underscores have all been used which really makes the nice names ugly. Fixing this was easy, I just used the MYSQL replace command:

UPDATE `table` SET `field` = REPLACE(Field,'change_me','to_me');

Or specifically for the tags:

UPDATE `wp_tags` SET `tag` = REPLACE(tag,'_',' ');