0%

MySQL导入数据命令

1
source   d:/myprogram/database/db.sql

导入sql文件过慢,解决办法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mysql -u root -p -h 127.0.0.1
mysql>use cloud_followup_gfe;
Database changed

mysql> set global innodb_flush_log_at_trx_commit=0;
Query OK, 0 rows affected (0.03 sec)

mysql> set global max_allowed_packet=1024*1024*20;
Query OK, 0 rows affected (0.00 sec)

mysql> set global bulk_insert_buffer_size=32*1024*1024;
Query OK, 0 rows affected (0.00 sec)

mysql> set global innodb_buffer_pool_size=32*1024*1024;
Query OK, 0 rows affected, 1 warning (0.09 sec)

>mysql source /root/test.sql