操作数据库用到了laravel的Model类,查看Model源码,发现每次查询和更新都会记录 日志 和发布事件。在运行脚本之前手动关闭:\DB::disableQueryLog(); \DB::unsetEventDispatcher(); Model::unsetEventDispatcher();