Newrelic is an application monitoring tool that truly is developer’s best friend. It’s such a true statement. I’ve used Newrelic to pinpoint and successfully troubleshoot numerous applications. I’ve recently switched all database tables from MyISAM to InnoDB for a couple of reasons that are outside the scope of this post. What came to my intention is [...]
Delete Revisions in WordPress – HOWTO
Delete Revisions in WordPress When you write articles in WordPress, your revisions will periodically get saved in the database. This is a useful feature, however, each revision that is saved by WordPress results in a new record in your MySQL database. I don’t have a problem with having revisions stored in the database for my [...]
Installing Python MySQLdb on OS X Lion
Tonight I tried installing a Python MySQLdb module, but when I ran the setup I got the following error: sh: mysql_config: command not found Traceback (most recent call last): File “setup.py”, line 15, in metadata, options = get_config() File “/Users/markotomic/MySQL-python-1.2.3/setup_posix.py”, line 43, in get_config libs = mysql_config(“libs_r”) File “/Users/markotomic/MySQL-python-1.2.3/setup_posix.py”, line 24, in mysql_config raise EnvironmentError(“%s [...]
MySQL cursors in stored procedures
I’ve wanted to write a few stored procedures in MySQL for a while now, but I found it very fiddly and was unable to come up with one very quickly. Tonight I was determined to read up on MySQL documentation and get one going. For my reference only, this stored procedure will loop through a [...]
MySQL REPLACE statement with dynamic variables
I just wrote a little mysql snippet that will replace all instances of ‘domain1′ to ‘domain2′ in a given table and column. So why not share it. All you need to do is set the variable values in first 4 lines of code below: SET @tblname = “tablename”; SET @colname = “columnname”; SET @lookfor = [...]
MySQL startup script on Mac OS X Snow Leopard
I’ve had problems starting up MySQL database server on startup on Snow Leopard. MySQL preference pane seems to be flaky and it often fails to start MySQL server. I created this startup script myself and it seems to work nicely. sudo nano /System/Library/LaunchDaemons/org.mysql.mysqld.plist <?xml version=”1.0″ encoding=”UTF-8″?> <!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”> <plist version=”1.0″> [...]
Snow Leopard Gotchas
I recently upgraded to Snow Leopard from 10.5 and everything went relatively smoothly. I was particularly pleased to see extra 13GB of hard drive space. However, I noticed a couple of things that I wasn’t so pleased about: Apache unable to start PHP disabled MySQL unable to start I’ve already walked a couple of people [...]



Comments