\r\n@echo off\r\nset path=C:\\Program Files\\MySQL\\MySQL Server 5.7\\bin\r\ncd .\/\r\nset CURR_PATH=%cd%\r\nmysql -h localhost -u root --password=123456 < operate.txt \r\nmysql -h localhost -u root -p stcounter < stcounter.sql --password=123456\r\n<\/pre>\n@echo off\uff1a\u5173\u95ed\u56de\u663e \u4e0d\u51fa\u73b0\u5728doc\u547d\u4ee4\u6846\u5185\u3002<\/p>\n
set path\uff1a\u8bbe\u7f6e\u7cfb\u7edf\u73af\u5883\u53d8\u91cf C:\\Program Files\\MySQL\\MySQL Server 5.7\\bin \u8fd9\u4e2a\u8def\u5f84\u662f\u4f60windows\u672c\u5730\u5740\u5b89\u88c5mysql\u670d\u52a1\u7684\u8def\u5f84<\/p>\n
\r\ncd .\/\r\nset CURR_PATH=%cd% \u8fd9\u4e24\u884c\u662f\u56fa\u5b9a\u5199\u6cd5\u3002\r\nmysql -h localhost -u root --password=123456 < operate.txt \r\n<\/pre>\n\u8fd9\u53e5\u8bdd\u7684\u610f\u601d\u5c31\u662f \u8d26\u53f7\u5bc6\u7801\u767b\u5f55\u540e \u521b\u5efaoperate\u6587\u4ef6\u4e2d\u7684\u6570\u636e\u5e93 operate\u6587\u4ef6\u4e2d\u5c31\u4e00\u53e5\u8bdd\uff1acreate database stcounter;<\/p>\n
\u8fd9\u91cc\u9762 \u4f60\u53ea\u8981\u9700\u8981\u66ff\u6362\u8d26\u53f7\u548c\u5bc6\u7801 \u548c \u521b\u5efa operate\u6587\u4ef6\u5373\u53ef <\/p>\n
\r\nmysql -h localhost -u root -p stcounter < stcounter.sql --password=123456\r\n<\/pre>\n\u8fd9\u91cc\u9762\u7684stcounter \u662f\u521b\u5efa\u6570\u636e\u5e93\u7684\u540d\u5b57 stcounter.sql\uff1a\u6211\u8fd9\u91cc\u662fNavicat\u5bfc\u51fa\u6765\u7684sql\u811a\u672c \u540c\u6837\u8d26\u53f7\u548c\u5bc6\u7801\u66ff\u6362\u4e0b\u5c31\u53ef\u4ee5\u4e86<\/p>\n
\u4e0b\u9762\u662f\u5176\u4ed6\u8865\u5145\u4e00<\/strong><\/div>\n\r\n::set str \u662f\u5c06\u542b\u6709\u7a7a\u683c\u7684mysql\u8def\u5f84\u653e\u5728str\u91cc\r\nset str=\"C:\\JiaFa\\Setup\\MySQL Server 5.5\\bin\\\"\r\n::%%\u4e24\u4e2a\u767e\u5206\u53f7\u662f\u5f15\u7528\u4e0a\u9762\u7684\u53d8\u91cf\r\n%str%mysql.exe -h localhost -uroot -pjfkjyfb dajian < f:\\zzztest\\c_bw_list.sql>>f:\\zzztest\\dblog.txt 2>&1\r\n::pause \u662f\u6682\u505c\uff0c\u53ef\u4ee5\u770b\u6267\u884c\u8fc7\u7a0b\uff0c\u6210\u529f\u4e86\u5c31pause\u5220\u6389\u5427\r\npause\r\n<\/pre>\nbat\u6587\u4ef6\u6267\u884c.sql\u6587\u4ef6<\/strong><\/div>\n\u6279\u5904\u7406\u6587\u4ef6.bat\u5199\u6cd5<\/p>\n
\r\n@echo off \r\nset errorlevel=0 \r\n \r\n\/\/\u4fee\u6539\u4e3amysql\u5b89\u88c5\u8def\u5f84 \r\nset path_home_mysql=\"E:\\tools\\2008\\MySql5.0\\\" \r\nset path_bin_mysql=%path_home_mysql%bin\\ \r\n \r\n\/\/\u4fee\u6539\u4e3amysql\u4f7f\u7528\u7684\u6570\u636e\u540d(test) \r\nset database_mysql=test \r\n \r\n\/\/\u4fee\u6539\u4e3amysql\u767b\u9646\u7528\u6237\u540d\u5bc6\u7801(root,sujian) \r\nset user_mysql=root \r\nset password_mysql=sujian \r\n \r\n\/\/\u4fee\u6539\u8981\u6267\u884c\u7684.sql\u6587\u4ef6(testsql.sql) \r\n%path_bin_mysql%mysql -u%user_mysql% -p%password_mysql% < testsql.sql\r\n<\/pre>\ntestsql.sql\u5199SQL\u8bed\u53e5<\/p>\n
\r\nalter table ddd add column ddddd varchar(10);\r\n<\/pre>\n\u603b\u7ed3\u4e00\u4e0b\uff1a<\/p>\n
1.\u5982\u679c\u662f\u6267\u884c\u6570\u636e\u5e93insert,update,delete\u8bed\u53e5\u7684\u8bdd,\u9700\u8981\u52a0\u5165\u6570\u636e\u5e93\u540d\u5982\uff1a<\/p>\n
\r\n%path_bin_mysql%mysql -u%user_mysql% -p%password_mysql% % database_mysql %< mytestsql.sql\r\n<\/pre>\nmytestsql.sql\u5199\u7684SQL\u8bed\u53e5\uff1a<\/p>\n
\r\nupdate user set english_name='bat test' where id='e605f35d-cf28-4ee9-abb8-812fe539c37a';\r\n<\/pre>\n2.\u5982\u679c\u662f\u6267\u884c\u6570\u636e\u5e93\u64cd\u4f5c\u8bed\u53e5\u5982\uff1a<\/p>\n
\r\n%path_bin_mysql%mysql -u%user_mysql% -p%password_mysql% < createtestdb.sql\r\n<\/pre>\ncreatetestdb.sql\u7684\u5185\u5bb9\uff1a<\/p>\n
\r\ncreate database test;\r\n<\/pre>\n3.\u53ef\u4ee5\u5c06mysql\u547d\u4ee4\u6539\u4e3amysqldump\u547d\u4ee4\u5c31\u53ef\u4ee5\u5bfc\u51fa\u6570\u636e\u5e93\u5907\u4efd\uff0c\u5982\uff1a<\/p>\n
\r\n%path_bin_mysql%mysqldump -u%user_mysql% -p%password_mysql% % database_mysql % > backuptestdb.sql<\/pre>\n","protected":false},"excerpt":{"rendered":"\u5b9e\u4f8b\u4ee3\u7801 @echo off set path=C:\\Program Files\\MySQL\\MySQL Se […]<\/p>\n","protected":false},"author":362,"featured_media":133286,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-217286","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/217286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/362"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=217286"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/217286\/revisions"}],"predecessor-version":[{"id":217508,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/217286\/revisions\/217508"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/133286"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=217286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=217286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=217286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}