Select Page

Delete MySQL Rows Older Than Date

I ran into a problem recently where I needed to delete all rows in a MySQL table that were older than three months. This I was able to accomplish with the following statement: MySQL DELETE FROM `table` WHERE `column` < DATE_SUB(NOW(), INTERVAL 3 MONTH); 1 DELETE...

Perform Basic MySQL Database Operations

Assuming you are a superuser, create a new database: [code]mysqladmin -p create db_name[/code] Import data: [code]mysql -p db_name < db_name.sql[/code] Dump the db: [code]mysqldump -p –opt db_name > db_name.sql[/code] Backup! Here’s a script called...