Tuesday, March 25, 2014

MySQL Utilities

mysqldump is an effective tool to backup MySQL database. It creates a *.sql file with DROP table, CREATE table and INSERT into sql-statements of the source database. To restore the database,  execute the *.sql file on destination database.  For MyISAM, use mysqlhotcopy method that we explained earlier, as it is faster for MyISAM tables.

backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql
 
 
Random Data 

http://stackoverflow.com/questions/10788285/how-to-update-insert-random-dates-in-sql-within-a-specified-date-range



No comments:

Post a Comment