mysql使用source导入大sql乱码处理以及慢的问题
因为sql非常大没法在第一行加入utf-8标识
我们先命令进入库, use xxx;
然后执行set names utf-8 ;
然后在source xxxx.sql; 这个时候我们再看表就不是乱码了。
我们会发现导入sql非常慢,一万行自增都要导入很久。
SHOW VARIABLES LIKE 'innodb_flush_log_at_trx_commit' ;
SET GLOBAL innodb_flush_log_at_trx_commit =0;
SET GLOBAL innodb_flush_log_at_trx_commit =1;