Phillip Pearson - web + electronics notes

tech notes and web hackery from a new zealander who was vaguely useful on the web back in 2002 (see: python community server, the blogging ecosystem, the new zealand coffee review, the internet topic exchange).

2006-12-18

MySQL - keeping a local hot backup

Here's a clever idea: run two copies of MySQL (a master and a slave) on one machine so you can shut down the slave to populate another database.

I'm planning out PeopleAggregator's MySQL replication code at the moment, and am doing the initial testing by running multiple MySQL servers on my laptop. It's not as hard as it sounds:

mkdir -p /home/phil/mysqlroot/data /home/phil/mysqlroot/log
mysql_install_db --basedir=/usr --datadir=/home/phil/mysqlroot/data --pid-file=/home/phil/mysqlroot/mysqld.pid --skip-locking --port=3307 --socket=mysqld.sock --log=/home/phil/mysqlroot/log/mysql.log --log-slow-queries=/home/phil/mysqlroot/log/mysql-slow.log
/usr/sbin/mysqld --basedir=/usr --datadir=/home/phil/mysqlroot/data --pid-file=/home/phil/mysqlroot/mysqld.pid --skip-locking --port=3307 --socket=mysqld.sock --log=/home/phil/mysqlroot/log/mysql.log --log-slow-queries=/home/phil/mysqlroot/log/mysql-slow.log
... more like this: []