dbcli / mycli

A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
http://mycli.net
Other
11.39k stars 657 forks source link

Importing csv file through mycli is impossible #724

Open hwooo opened 5 years ago

hwooo commented 5 years ago
[mycli -u root]
LOAD DATA
LOCAL INFILE 'file_path'
INTO TABLE db.table FIELDS TERMINATED BY ',';

-> 1148, 'The used command is not allowed with this MariaDB version'

[mysql -u root]
LOAD DATA
LOCAL INFILE 'file_path'
INTO TABLE db.table FIELDS TERMINATED BY ',';

-> Query OK

Same table, same query is used but importing csv through mycli is impossible because of syntax issue.

meeuw commented 5 years ago

Could you try to start mycli using the argument --local-infile=true and retry the LOAD DATA command?

The official mysql client requires this as well but it might by preconfigured for you somewhere. You can also add local_infile = true to my.cnf and mycli should use it as well.

hwooo commented 5 years ago

Can I add local_infile = true to .myclirc file?

meeuw commented 5 years ago

Hmm, no, but you can add it to ~/.my.cnf and if I'm not mistaking you should use local-infile = 1 or loose-local-infile = 1