//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 'source 1.dat' at line 1
mysql> source 1.dat
ERROR:
Failed to open file '1.dat', error: 2
同样的SQL,不同的结果,请教何故?已排除环境等原因
8 个解决方案
#1
解决了:
Note that the 'source' command used in the mysql client program is *not* a feature of the server but of the client.
This means that you cannot do
mysql_query('source myfile.sql');
You will get a syntax error. Use LOAD DATA INFILE as an alternative.
Note that the 'source' command used in the mysql client program is *not* a feature of the server but of the client.
This means that you cannot do
mysql_query('source myfile.sql');
You will get a syntax error. Use LOAD DATA INFILE as an alternative.
#2
刚想要回帖了,居然解决了,楼主两个星了,果然是不耻下问啊,佩服佩服。
source应该是mysql客户端工具下的一个命令,php mysql扩展中没有这个用法。
source (\.) Execute an SQL script file. Takes a file name as an argument.
source应该是mysql客户端工具下的一个命令,php mysql扩展中没有这个用法。
source (\.) Execute an SQL script file. Takes a file name as an argument.
#3
哈,能结贴了
顺便请教一下,如果我想在PHP中安装一个存储过程,应该如何实现?
顺便请教一下,如果我想在PHP中安装一个存储过程,应该如何实现?
#4
安装存储过程?是不是调用哦?
#5
我来接点分。
#6
用PHP拼成一个存储过程,然后调用,其用法跟asp.net等语言不用,感觉php还没有发展到那个地步!
#7
不是调用,是要用PHP在MySQL里建立一个存储过程。主要是不会解决DELIMITER的问题
#8
存储过程不怎么熟~~还有待学习啊
#1
解决了:
Note that the 'source' command used in the mysql client program is *not* a feature of the server but of the client.
This means that you cannot do
mysql_query('source myfile.sql');
You will get a syntax error. Use LOAD DATA INFILE as an alternative.
Note that the 'source' command used in the mysql client program is *not* a feature of the server but of the client.
This means that you cannot do
mysql_query('source myfile.sql');
You will get a syntax error. Use LOAD DATA INFILE as an alternative.
#2
刚想要回帖了,居然解决了,楼主两个星了,果然是不耻下问啊,佩服佩服。
source应该是mysql客户端工具下的一个命令,php mysql扩展中没有这个用法。
source (\.) Execute an SQL script file. Takes a file name as an argument.
source应该是mysql客户端工具下的一个命令,php mysql扩展中没有这个用法。
source (\.) Execute an SQL script file. Takes a file name as an argument.
#3
哈,能结贴了
顺便请教一下,如果我想在PHP中安装一个存储过程,应该如何实现?
顺便请教一下,如果我想在PHP中安装一个存储过程,应该如何实现?
#4
安装存储过程?是不是调用哦?
#5
我来接点分。
#6
用PHP拼成一个存储过程,然后调用,其用法跟asp.net等语言不用,感觉php还没有发展到那个地步!
#7
不是调用,是要用PHP在MySQL里建立一个存储过程。主要是不会解决DELIMITER的问题
#8
存储过程不怎么熟~~还有待学习啊