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 旧数据(一年多)归档到一个文件,并从数据库中删除相同的信息。这样我的数据库中只有去年的数据。
有人可以帮助我吗?
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