1.重启php-fpm:ps -ef |grep php-fpm kill id , /usr/local/php/sbin/php-fpm -c /etc/php.ini
2.重启nginx: /usr/local/nginx/sbin/nginx -s reload
3.导出数据库:mysqldump -h host -u user -p dbname>bak.sql
4.导入sql文件(需要存在该数据库):mysql -u user -p dbname<bak.sql
5.shell批处理(创建并导入sql文件)
#!/bin/bash array=(ws_bjjy ws_chjy ws_dgjy ws_fsjy ws_gdfsjy ws_gdjy ws_gmjy ws_gzjy ws_hdjy ws_hjjy ws_hyjy ws_hzjy ws_jmjy ws_jyzxyy ws_lcjy ws_mmjy ws_mzjy ws_nzjy ws_pyjy ws_qyjy ws_sgjy ws_shjy ws_wgs ws_wjjy ws_ycjy ws_ydjy ws_yjjy) for name in ${array[@]} do echo $name mysql -h127.0.0.1 -uroot -padmin123 -e "create database if not exists $name";
mysql -h127.0.0.1 -uroot -padmin123 $name < $name.sql done
6、批量修改目录文件字符串
sed -i "s/查找字段/替换字段/g" `grep 查找字段 -rl 路径`
sed -i "s//opt/webroot/mibo/dev/think//opt/webroot/mibo/default/think/g" `grep /opt/webroot/mibo/dev/think -rl ./`