Archive for April, 2010

Moving Users on MySQL

April 28, 2010

Copying users from a database on host1 to a database on host2 under MySQL:
echo "select concat(\"show grants for '\", user,\"'@'\", host, \"';\") from user where host='localhost' or host = '127.0.0.1';" | mysql -u root -p --skip-column-names -h host1 mysql | mysql -u root -p --skip-column-names -h host1 mysql | sed 's/$/;/' | mysql -u root -p -h host2

SVN Administration The Hard Way

April 23, 2010

For the last couple years, I’ve worked with a couple people who know a whole lot more than I do about svn, and so my troubleshooting method has been to ask someone smarter than me. I no longer work with those people. So, today I learned a couple lessons about subversion administration the hard way.

First, if everything that talks to the repository just hangs, svn is probably “wedged” and the way to fix it is to shutdown everything that uses svn (ie apache if you are using svn over https) and then as the repository user (again apache in the above case) you run the command:

svnadmin recover /var/svn/repos

And then you pray (unless you backup your svn repository database, in which case you still have an out.)

Also the SVN Book’s Repository Maintenance page is your friend. (It teaches you how to make backups too!)