MySQL 加载 XML 本地内嵌文件
我正在本地计算机上构建一个应用程序,并且在很长一段时间内使用安装了 MySQL 的 Windows 7,但由于我现在已转移到 Linux,我正在尝试执行以下语句:
LOAD XML LOCAL INFILE 'http://example.com/tech.xml'
INTO TABLE t
ROWS IDENTIFIED BY '<product>';
这不起作用,并且我确实拥有实现这一目标所需的所有特权。
我怎样才能使这个声明发挥作用?
当我使用 Windows (r) 时,该语句可以完美运行。如果我想通过 MySQL 访问该文件,我应该将该文件放在 Web 服务器上的什么位置?
我收到此错误:
Error Code: 1064. 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 'XML LOCAL INFILE 'http://example.com/tech.xml'
INTO TABLE t
ROWS IDENTIFIE' at line 1
I'm building an application on my local machine, and for the longest time, was using Windows 7 with MySQL installed, but as I've now moved onto Linux, I'm trying to execute this statement:
LOAD XML LOCAL INFILE 'http://example.com/tech.xml'
INTO TABLE t
ROWS IDENTIFIED BY '<product>';
This is not working, and I do have all the privileges necessary in order to accomplish this.
How can I make this statement work?
When I was using Windows (r) the statement would work perfectly. Where do I put the file on my web server if I want to access it via MySQL?
I get this error:
Error Code: 1064. 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 'XML LOCAL INFILE 'http://example.com/tech.xml'
INTO TABLE t
ROWS IDENTIFIE' at line 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
加载 XML INFILE
是从 mySQL 5.2 及更高版本可用。您可能拥有比该版本更旧的版本。
LOAD XML INFILE
is available from mySQL 5.2 and higher.You probably have an older version than that.