You are heremysql

mysql


Accidently hosed a post last night

I accidentally hosed a post last night. I was trying to delete an attachment to a post but instead deleted the entire post. Luckily I have nightly backups, so restore was quick and easy. It was the first time in a LONG time that I've had to restore the database, but I am extremely relieved that my backup system is working perfectly. I also rsync the backups to my home computer they are stored in two different places.,

Hibernate-3.2.x/JDBC-3.1.x Does Not Work With MySQL 4.1.x

I just spent six hours today trying to figure out why the Hibernate example I set up and the example in the "eg" directory of the Hibernate binary distribution both did not work. The example I made was doing something really simple, filling in 3 attributes in a table. It was putting in garbage instead. The "auction" example that comes with Hibernate (in the "eg" directory) would just cack, leaving me with all sorts of confusing log messages.

Since the "auction" example worked at my work computer so I thought about what was different on that computer. I then thought that my work computer might have been using mysql-5, while my home computer is still using mysql-4.1.x. I had tried upgrading to mysql-5 a few months ago but it didn't work for some reason. I tried following the instructions for upgrading mysql on gentoo again and they worked flawlessly. I tried running the hibernate auction example by typing ant eg and it worked. Next I tried running the example I made myself and it worked as well. Finally, 6 hours later, and it looks like the solution was to upgrade to mysql-5.x.

Backing up MySQL Databases With AutoMySQLBackup

I just discovered a very useful bash script tonight, AutoMySQLBackup. It is a nice and easy way to backup your mysql databases daily, weekly, and monthly. It was very easy to set up and works great. A great suggestion to prevent having to put the username and password for a database user with read/write access in the script is to do the following:

mysql -u root -p -e "GRANT SELECT, LOCK TABLES ON *.* TO 'backup'@'localhost' IDENTIFIED BY 'backupPW';"

MySQL Backup Script

Great, simple little MySQL backup script here at B&T's Tips & Scripts. I just got it set up and so dumps of my database are now being made every night at midnight or whenever I call the script (as I did right now before installed the gsitemap drupal module).