语法:mysqldump -u <用户名> -p <密码> <数据库名> > <导出文件路径>
// 导出表结构
mysqldump -u app -p -d database> /home/appmanager/temp/20230719/content_moderation_test.sql
// 导出表结构 + 数据
mysqldump -u app -p database table> /home/appmanager/temp/20230719/content_moderation_test.sql
// 查询导出
mysql -u root -p -e "select * from rich_media" content_moderation > /data/tmp.txt
mysql -u root -p -e "select * from sys_dept" content_moderation > /home/appmanager/temp/sys_dept.xls
mysql -u root -p -e "SELECT request_id FROM ai_request WHERE TIMESTAMPDIFF(MINUTE, insert_time, thread_one_finish_time) > 5 and insert_time BETWEEN '2023-10-25 00:00:00' and '2023-10-26 00:00:00'" content_moderation_ISP > /home/appmanager/temp/ai_request_id.txt
// 执行sql文件
source /…/xxx.sql