遇到问题--mac下MySQL8使用mysqlimport出现The used command is not allowed with this MySQL version

情况

使用mysqlimport命令把csv文件导入到mysql中,报错如下:

zhangxiaofans-MacBook-Pro:aws-money-result joe$ mysqlimport --ignore-lines=1 --fields-terminated-by=,  --user=root --password=12345678   -h 127.0.0.1 -P 3306  --local billing   billing.csv
mysqlimport: [Warning] Using a password on the command line interface can be insecure.
mysqlimport: Error: 1148, The used command is not allowed with this MySQL version, when using table: billing

使用的mysql版本查看

mysql -u root -h 127.0.0.1 -P 3306 -p
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.13    |
+-----------+

原因

If LOAD DATA LOCALis disabled, either in the server or the client, a client that attempts to issue such a statement receives the fol-lowing error message:

ERROR 1148: The used command is not allowed with this MySQL version
可见,出于安全考虑,默认是不允许从client host远程通过load data或者mysqlimport命令导入数据的

查看lo

猜你喜欢

转载自blog.csdn.net/q383965374/article/details/102950906