Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
mysql の古いデータ (1 年以上) をファイルにアーカイブし、同じ情報をデータベースから削除したいと考えています。このようにして、データベースには昨年のデータしかありません。
誰かが私を助けることができますか?
mysql -e "select * from your_table where `date` < now() - interval 1 year" -u myuser -pxxxxxxxxx mydatabase > mydumpfile.txt delete from your_table where `date` < now() - interval 1 year