美文网首页
mysql工具1

mysql工具1

作者: 薇薇一笑vv | 来源:发表于2017-07-07 19:04 被阅读0次

1. mysql可以直接load data

用法:LOAD DATA [LOW_PRIORITY] [LOCAL] INFILE 'file_name.txt' [REPLACE | IGNORE] INTO TABLE tbl_name
  <small>默认字段分割符:\t, 默认行分隔符:\n </small>
  <small>示例:load data infile "file.txt" into table comments character set utf8 (id,comment);</small>
  <small>如果出现错误:</small>
<pre>The MySQL server is running with the --secure-file-priv option so it cannot execute this statement</pre>
执行:
<pre> show variables like '%secure%';
+--------------------------+-----------------------+
| Variable_name | Value |
+--------------------------+-----------------------+
| require_secure_transport | OFF |
| secure_auth | ON |
| secure_file_priv | /var/lib/mysql-files/ |
+--------------------------+-----------------------+</pre>
  <small>将文件移动到/var/lib/mysql-files/,指定文件位置/var/lib/mysql-files/file_name.txt,重新执行 。具体用法</small>

相关文章

网友评论

      本文标题:mysql工具1

      本文链接:https://www.haomeiwen.com/subject/qcsrhxtx.html