mysql

Wednesday, July 12, 2006

Live Backups of MySQL Using Replication

One of the difficulties with a large and active MySQL database is making clean backups without having to bring the server down. Otherwise, a backup may slow down the system and there may be inconsistency with data, since related tables may be changed while another is being backed up. Taking the server down will ensure consistency of data, but it means interruption of service to users. Sometimes this is necessary and unavoidable, but daily server outages for backing up data may be unacceptable. A simple alternative method to ensure reliable backups without having to shut down the server daily is to set up replication for MySQL.

http://www.onlamp.com/pub/a/onlamp/2005/06/16/MySQLian.html

Sunday, July 02, 2006

SQL result -> File

There is a nice article about how to issue an sql and put the result in a file.
Basically its something like:

mysql> select emp_id, emp_name from emps into outfile 'c:/test.txt';
Query OK, 4 rows affected (0.03 sec)

http://gilfster.blogspot.com/2005/11/writing-sql-results-to-file.html