MySQL

Automating MySQL Database Backups on the Command Line via mysqldump

Are you tired of manually running backups when you remember to?

If you are running your own server, or have access to the shell and cron jobs this tip is for you!

First off for a better understanding of mysqldump check out the MySQL reference manual. All mysqldump really does is output the necessary queries to rebuild your database to the current state it is at when run.

First I’m going to create a test database and some tables as examples:

› Continue reading

Tags: , , , , ,

Creating JSON as a select result in a MySQL Query

So I had this crazy idea at work, I needed to get all the data out of an entire table in a single column. So I decided to return the table as a preformatted JSON array that I could decode straight into a php array for manipulation.

The Code:
› Continue reading

Tags: ,

Monday, January 12th, 2009 MySQL, Programming, php 1 Comment

Powered by Twitter Tools