mysql工具1

1. mysql可以直接load data

用法:LOAD DATA [LOW_PRIORITY] [LOCAL] INFILE 'file_name.txt' [REPLACE | IGNORE] INTO TABLE tbl_name
  默认字段分割符:\t, 默认行分隔符:\n 
  示例:load data infile "file.txt" into table comments character set utf8 (id,comment);
  如果出现错误:

The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

执行:
 show variables like '%secure%';
+--------------------------+-----------------------+
| Variable_name | Value |
+--------------------------+-----------------------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | /var/lib/mysql-files/ |
+--------------------------+-----------------------+

  将文件移动到/var/lib/mysql-files/,指定文件位置/var/lib/mysql-files/file_name.txt,重新执行 。具体用法

你可能感兴趣的:(mysql工具1)