<small id='PFgh8'></small><noframes id='PFgh8'>

<legend id='PFgh8'><style id='PFgh8'><dir id='PFgh8'><q id='PFgh8'></q></dir></style></legend>

    • <bdo id='PFgh8'></bdo><ul id='PFgh8'></ul>

      1. <i id='PFgh8'><tr id='PFgh8'><dt id='PFgh8'><q id='PFgh8'><span id='PFgh8'><b id='PFgh8'><form id='PFgh8'><ins id='PFgh8'></ins><ul id='PFgh8'></ul><sub id='PFgh8'></sub></form><legend id='PFgh8'></legend><bdo id='PFgh8'><pre id='PFgh8'><center id='PFgh8'></center></pre></bdo></b><th id='PFgh8'></th></span></q></dt></tr></i><div id='PFgh8'><tfoot id='PFgh8'></tfoot><dl id='PFgh8'><fieldset id='PFgh8'></fieldset></dl></div>
        <tfoot id='PFgh8'></tfoot>
      2. MySql 加载数据本地语法?

        MySql Load Data Local Syntax?(MySql 加载数据本地语法?)

              <legend id='se3wU'><style id='se3wU'><dir id='se3wU'><q id='se3wU'></q></dir></style></legend>

              <i id='se3wU'><tr id='se3wU'><dt id='se3wU'><q id='se3wU'><span id='se3wU'><b id='se3wU'><form id='se3wU'><ins id='se3wU'></ins><ul id='se3wU'></ul><sub id='se3wU'></sub></form><legend id='se3wU'></legend><bdo id='se3wU'><pre id='se3wU'><center id='se3wU'></center></pre></bdo></b><th id='se3wU'></th></span></q></dt></tr></i><div id='se3wU'><tfoot id='se3wU'></tfoot><dl id='se3wU'><fieldset id='se3wU'></fieldset></dl></div>
              <tfoot id='se3wU'></tfoot>
                <tbody id='se3wU'></tbody>

              <small id='se3wU'></small><noframes id='se3wU'>

                • <bdo id='se3wU'></bdo><ul id='se3wU'></ul>
                • 本文介绍了MySql 加载数据本地语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个使用管道'|'的文本文件result.txt"分离字段.我使用了 PhpMyAdmin 并通过指定使用CSV 负载数据"并告诉它字段应该用|"分隔来成功地将它导入到我的表中.

                  I have a text file "result.txt" that used pipes '|' to separate out the fields. I used PhpMyAdmin and successfully imported it to my table by specifying using "CSV LOAD DATA" and telling it the fields should be separated by '|'.

                  PhpMyAdmin 也给出了完整的查询,所以我复制了它并粘贴到我的 php 脚本中,如下所示:

                  PhpMyAdmin also gave the full query for it, so I copied it and paste it into my php script, which looked like this:

                   mysql_query("LOAD DATA LOCAL INFILE 'C:/wamp/www/TouchStone/result.txt' INTO TABLE customer_change FIELDS TERMINATED BY '|' ESCAPED BY '\' LINES TERMINATED BY '
                  ' ")
                   or die(mysql_error());
                  

                  我总是会收到错误提示:

                  I will always receieve error saying:

                  您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以获取在第 2 行的 ''' 附近使用的正确语法

                  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 2

                  我想知道,因为我复制了 phpmyadmin 生成的完全相同的查询,我认为它肯定会在这里工作.但是为什么会出现这样的错误呢?

                  I was wondering, since I copied exactly the same query generated by phpmyadmin, I think it will definitely work here. But why will such error happen?

                  我尝试修剪查询以仅包含FIELDS TERMINATED BY"并且它起作用了.但是以这种方式填充的数据库将包含不正确的数据.所以我真的很想知道为什么原来的较长查询会失败?

                  I tried trimming the query to contain only "FIELDS TERMINATED BY " and it worked. But the database populated this way will contain incorrect data. So I am really wishing to learn why would the original longer query would fail?

                  谢谢.

                  推荐答案

                  您正在使用双引号字符串,因此 将被视为文字回车和换行人物.您还需要对它们进行双重转义:\r\n.

                  You're using a double-quoted string, so the will be seen as literal carriage return and line feed characters. You'll need to double-escape them as well: \r\n.

                  错误消息中的第 2 行"证明了这一点 - 如果您的查询没有实际的第二行,但由于嵌入的换行符/回车,一旦它到达 MySQL.

                  The "on line 2" in the error message is evidence of this - there's no actual second line if your query, but because of the embedded newline/carriage return, there is once it gets to MySQL.

                  这篇关于MySql 加载数据本地语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                        <tbody id='UVDFU'></tbody>
                        <i id='UVDFU'><tr id='UVDFU'><dt id='UVDFU'><q id='UVDFU'><span id='UVDFU'><b id='UVDFU'><form id='UVDFU'><ins id='UVDFU'></ins><ul id='UVDFU'></ul><sub id='UVDFU'></sub></form><legend id='UVDFU'></legend><bdo id='UVDFU'><pre id='UVDFU'><center id='UVDFU'></center></pre></bdo></b><th id='UVDFU'></th></span></q></dt></tr></i><div id='UVDFU'><tfoot id='UVDFU'></tfoot><dl id='UVDFU'><fieldset id='UVDFU'></fieldset></dl></div>
                      1. <legend id='UVDFU'><style id='UVDFU'><dir id='UVDFU'><q id='UVDFU'></q></dir></style></legend>

                          <bdo id='UVDFU'></bdo><ul id='UVDFU'></ul>
                        • <small id='UVDFU'></small><noframes id='UVDFU'>

                          <tfoot id='UVDFU'></tfoot>