我想用一个存储过程导入数据.可惜语法都是错的。
DELIMITER $$
CREATE PROCEDURE xx()
BEGIN
source c:/x1.sql
END $$
DELIMITER ;ERROR 1064 (42000): 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 'c:/x1.sql END' at line 3请各位大哥讲解 ,怎样在存储过程里面使用source....
DELIMITER $$
CREATE PROCEDURE xx()
BEGIN
source c:/x1.sql
END $$
DELIMITER ;ERROR 1064 (42000): 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 'c:/x1.sql END' at line 3请各位大哥讲解 ,怎样在存储过程里面使用source....
OR
用MYSQLDUMP导入
mysqldump 好像是到出的
mysqldump 可以导入吗?
你是怎么知道source 不是sql的命令。
我在mysql client里面可以运行为什么不是sql命令。。
如果说它是第三方工具,那貌似mysqldump也是第三方的吧
那为什么mysqldump可以呢?
别告诉我mysql sql命令大全里面没有这个命令,所以他不是sql命令。。- -! 以上有误解的地方,希望各位大哥明示。。
mysql> helpFor information about MySQL products and services, visit:
http://www.mysql.com/
For developer information, including the MySQL Reference Manual, visit:
http://dev.mysql.com/
To buy MySQL Enterprise support, training, or other products, visit:
https://shop.mysql.com/List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
? (\?) Synonym for `help'.
clear (\c) Clear the current input statement.
connect (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
help (\h) Display this help.
notee (\t) Don't write into outfile.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute an SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
use (\u) Use another database. Takes database name as argument.
charset (\C) Switch to another charset. Might be needed for processing binlog
with multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.For server side help, type 'help contents'mysql>
echo.
echo 开始替换存储过程"D:\mysql6\bin\mysql" -uroot -p123 test<c:\1.sql
"D:\mysql6\bin\mysql" -uroot -p123 test<c:\2.sql
"D:\mysql6\bin\mysql" -uroot -p123 test<c:\3.sqlecho.echo 存储过程替换完成echo.
echo.pausetest是你要脚本处理的数据库。
D:\mysql6\bin是MYSQL的安装路径。