# 上传sql文件 yum install lrzsz -y cd /usr/local rz -be ============================================================================== # 备份 # 所有表 select table_name from information_schema.tables where table_schema='dsideal_db' and table_name like 't_un%'; # 备份多张表 mysqldump -uroot -pDsideaL147258369 dsideal_db wp_options > wordpress_1.sql # ============================================================================== # 还原办法 gunzip t_university_2021-09-30-14-21-51.sql.gz # 提取建表语句 sed -e '/./{H;$!d;}' -e 'x;/CREATE TABLE `t_university_zhuanye`/!d;q' t_university_2021-09-30-14-21-51.sql > table.sql # 提取表数据 grep 'INSERT INTO `t_university_info`' t_university_2021-09-30-14-21-51.sql > t_university_zhuanye.sql # 修正一下薪金和地区 update t_university_zhiye_gw set gw_salary=gw_area,gw_area='' where gw_salary ='' and gw_area<>'' and gw_area not like '热门%'; select *from t_university_zhiye_gw where gw_salary='';