Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql: unknown variable in `my.cnf`

I follow these instructions to speed up loading a big local file (500+M, 10+M rows) into MySQL, adding configurations to /etc/mysql/my.cnf:

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
local-infile=1

# add following code
innodb_doublewrite = 0
innodb_support_xa = 0

but encounter following issues:

mysql: unknown variable 'innodb_doublewrite=0'
mysql: unknown variable 'innodb_support_xa=0'

PS: MySQL version

$ mysql --version
mysql  Ver 14.14 Distrib 5.6.27, for debian-linux-gnu (x86_64) using  EditLine wrapper
like image 462
SparkAndShine Avatar asked Feb 25 '16 20:02

SparkAndShine


1 Answers

Put them under [mysqld], not [mysql].

Also, make sure that innodb_buffer_pool_size is about 70% of available RAM.

Even then, you may hit some timeout.

Or you may need to chunk the file up. (10K rows per chunk might be reasonable.)

like image 92
Rick James Avatar answered Nov 10 '22 11:11

Rick James