首页 > 数据库技术 > 详细

mysql api 不支持source命令

时间:2017-03-20 19:29:59      阅读:228      评论:0      收藏:0      [点我收藏+]

今天写了个代码

<?php

.....

mysql_query("source /tmp/cr.sql",$link);

.....

?>

 

结果死活cr.sql的SQL语句就是没效果,查了下,

SOURCE is definitely a command that is preprocessed by the mysql client. The server does not understand that command. So you can‘t execute SOURCE on the server using the query API.

If you can restrict the content of your SQL script to exclude mysql client builtin commands, it might work to use mysqli::multi_query(). But it won‘t work for the full set of commands that are allowed in an SQL script.

 

爪子下。。。下次不要犯这么弱智的错误

mysql api 不支持source命令

原文:http://www.cnblogs.com/amoy9812/p/6590899.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!