{"id":26046,"date":"2024-11-24T08:30:42","date_gmt":"2024-11-24T00:30:42","guid":{"rendered":"https:\/\/fwq.ai\/blog\/26046\/"},"modified":"2024-11-24T08:30:42","modified_gmt":"2024-11-24T00:30:42","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-shell-%e8%84%9a%e6%9c%ac%e5%ae%9e%e6%97%b6%e6%89%93%e5%8d%b0%e6%89%a7%e8%a1%8c-sql-%e7%9a%84%e8%bf%87%e7%a8%8b%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/26046\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u5b9e\u65f6\u6253\u5370\u6267\u884c SQL \u7684\u8fc7\u7a0b\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173078173334924.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u5b9e\u65f6\u6253\u5370\u6267\u884c SQL \u7684\u8fc7\u7a0b\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u5b9e\u65f6\u6253\u5370\u6267\u884c SQL \u7684\u8fc7\u7a0b\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u5b9e\u65f6\u6253\u5370\u6267\u884c sql \u7684\u8fc7\u7a0b<\/strong><\/p>\n<p>\u4f60\u7684 shell \u811a\u672c\u901a\u8fc7  \u547d\u4ee4\u6267\u884c sql \u811a\u672c\uff0c\u4f46\u662f\u6267\u884c\u540e\u4f1a\u5361\u6b7b\uff0c\u65e0\u6cd5\u5b9e\u65f6\u770b\u5230\u7ed3\u679c\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u4f7f\u7528 -v \u53c2\u6570\u8fdb\u884c\u4f18\u5316\u3002<\/p>\n<p>-v \u53c2\u6570\u5141\u8bb8 mysql \u547d\u4ee4\u5728\u6267\u884c sql \u8bed\u53e5\u65f6\u8f93\u51fa\u989d\u5916\u7684\u4fe1\u606f\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5b83\u4f1a\u6253\u5370\u6bcf\u4e2a\u8bed\u53e5\u7684\u72b6\u6001\u4fe1\u606f\uff0c\u5982\uff1a<\/p>\n<pre>query ok, 1 row affected (0.00 sec)\nrecords: 1  duplicates: 0  warnings: 0<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u901a\u8fc7\u5728\u4f60\u7684\u811a\u672c\u4e2d\u6dfb\u52a0 -v \u53c2\u6570\uff0c\u5373\u53ef\u5b9e\u65f6\u6253\u5370\u6267\u884c sql \u7684\u8fc7\u7a0b\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre>mysql -vvv -h$mysqlhost -uroot -p$rootpwd -P$mysqlport -e \n\"use mysql;source ${basepath}\/sql_execute\/apphub\/apphub_mysql_db_create.sql;\nsource ${basepath}\/sql_execute\/bam\/bam_mysql_db_create.sql;  \nsource ${basepath}\/sql_execute\/bim\/bim_mysql_db_create.sql; \nsource ${basepath}\/sql_execute\/epass\/epass_mysql_db_create.sql; \nuse apphub${suffix}; \nsource ${basepath}\/sql_execute\/apphub\/apphub_mysql_table_and_data.sql; \nuse bam${suffix}; \nsource ${basepath}\/sql_execute\/bam\/bam_mysql_table_and_data.sql; \nuse bim${suffix}; \nsource ${basepath}\/sql_execute\/bim\/bim_mysql_table_and_data.sql; \nuse epass${suffix}; \nsource ${basepath}\/sql_execute\/epass\/epass_mysql_table_and_data.sql;\" &gt; ${basepath}\/running_sql.log &amp;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cmysql -v \u7684\u8f93\u51fa\u53ef\u80fd\u8f83\u591a\uff0c\u56e0\u6b64\u4f60\u9700\u8981\u5408\u7406\u5730\u5904\u7406\u8fd9\u4e9b\u4fe1\u606f\uff0c\u4fdd\u8bc1\u811a\u672c\u7684\u5065\u58ee\u6027\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u5b9e\u65f6\u6253\u5370\u6267\u884c SQL \u7684\u8fc7\u7a0b\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u5b9e\u65f6\u6253\u5370\u6267\u884c sql \u7684\u8fc7\u7a0b \u4f60\u7684 shell \u811a\u672c\u901a\u8fc7 \u547d\u4ee4\u6267\u884c sql \u811a\u672c\uff0c\u4f46\u662f\u6267\u884c\u540e\u4f1a\u5361\u6b7b\uff0c\u65e0\u6cd5\u5b9e\u65f6\u770b\u5230\u7ed3\u679c\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u4f7f\u7528 -v \u53c2\u6570\u8fdb\u884c\u4f18\u5316\u3002 -v \u53c2\u6570\u5141\u8bb8 mysql \u547d\u4ee4\u5728\u6267\u884c sql \u8bed\u53e5\u65f6\u8f93\u51fa\u989d\u5916\u7684\u4fe1\u606f\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5b83\u4f1a\u6253\u5370\u6bcf\u4e2a\u8bed\u53e5\u7684\u72b6\u6001\u4fe1\u606f\uff0c\u5982\uff1a query ok, 1 row affected (0.00 sec) records: 1 duplicates: 0 warnings: 0 \u767b\u5f55\u540e\u590d\u5236 \u901a\u8fc7\u5728\u4f60\u7684\u811a\u672c\u4e2d\u6dfb\u52a0 -v \u53c2\u6570\uff0c\u5373\u53ef\u5b9e\u65f6\u6253\u5370\u6267\u884c sql \u7684\u8fc7\u7a0b\uff0c\u5982\u4e0b\u6240\u793a\uff1a mysql -vvv -h$mysqlhost -uroot -p$rootpwd -P$mysqlport -e &#8220;use mysql;source ${basepath}\/sql_execute\/apphub\/apphub_mysql_db_create.sql; source ${basepath}\/sql_execute\/bam\/bam_mysql_db_create.sql; source ${basepath}\/sql_execute\/bim\/bim_mysql_db_create.sql; source ${basepath}\/sql_execute\/epass\/epass_mysql_db_create.sql; use [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-26046","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26046","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=26046"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26046\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=26046"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=26046"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=26046"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}