日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

MySQL批處理SQL語句

系統 2055 0

MySQL 支持批處理的模式運行一批SQL語句,以下的樣例就是實驗MySQL怎樣在windows下批處理運行SQL語句。

create table test(id int,name varchar(20));
insert into test values(1,'watson');

?

batchfile.txt里包括以下的一些SQL 語句,此文件放在windows系統的c:/batchmysql/batchfile.txt

insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;
insert into test select * from test;

?

在cddl數據庫里進行批運行上面的語句例如以下:
mysql -uroot -p -D cddl < c:/batchmysql/batchfile.txt

?

以下是把批處理里含有查詢的信息,輸出保存到一個文件中:

此時的batchfile2.txt里含有query的信息(以下的3條SQL語句),以下的mysql0716.out就記錄了select * from test limit 200;查詢語句的結果集。
select * from test limit 200;
insert into test select * from test;
insert into test select * from test;


You can catch the output in a file for further processing:
mysql -uroot -p -D cddl < c:/batchmysql/batchfile2.txt >c:/batchmysql/mysql0716.out

MySQL批處理SQL語句


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 焦作市| 肇东市| 丹凤县| 油尖旺区| 郧西县| 扎囊县| 和平县| 建平县| 孟村| 大渡口区| 手游| 静宁县| 洛浦县| 府谷县| 衡阳市| 呈贡县| 方正县| 洛隆县| 伊金霍洛旗| 新宁县| 江孜县| 沐川县| 鲁甸县| 凤冈县| 交口县| 肇源县| 东台市| 商丘市| 龙里县| 南雄市| 舞阳县| 盘锦市| 久治县| 玉林市| 康定县| 汤原县| 宜章县| 三都| 安吉县| 通河县| 渝中区|