Automating MySQL Database Backups

One of the most critical tasks for a MySQL administrator is reliably backing up and restoring databases. This, of course, helps to prevent data loss in the event of a hardware failure, data corruption… or a little accident. Most modern hosting/server solutions have some kind of database backup solution available. However, many people prefer to…

MySQL Random Row

To get a random row from your table, you can use the following trick: This will return a single random row from myTable. Remember that you can also use a WHERE clause to narrow down the records before choosing a random one. This is a more efficient way of finding a random result than it…

MySQL Password Function – OLD_PASSWORD() and PASSWORD()

The PASSWORD() function in MySQL can generate a hash value for encrypted passwords, similar to md5() in PHP. It is generally not recommended to use this function in an application as it is not particularly secure – it is intended for internal use. If, however, your application uses the MySQL PASSWORD() function, you need to…