{"id":7412,"date":"2024-11-14T15:56:14","date_gmt":"2024-11-14T07:56:14","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7412\/"},"modified":"2024-11-14T15:56:14","modified_gmt":"2024-11-14T07:56:14","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-sql-%e6%89%a7%e8%a1%8c%e8%bf%87%e7%a8%8b%e5%b9%b6%e9%81%bf%e5%85%8d%e8%84%9a%e6%9c%ac%e5%8d%a1","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7412\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u5b9e\u65f6\u6253\u5370 SQL \u6267\u884c\u8fc7\u7a0b\u5e76\u907f\u514d\u811a\u672c\u5361\u6b7b\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173080033083826.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u5b9e\u65f6\u6253\u5370 SQL \u6267\u884c\u8fc7\u7a0b\u5e76\u907f\u514d\u811a\u672c\u5361\u6b7b\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u5b9e\u65f6\u6253\u5370 SQL \u6267\u884c\u8fc7\u7a0b\u5e76\u907f\u514d\u811a\u672c\u5361\u6b7b\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u8dd1\u5e93\uff0c\u5e76\u5b9e\u65f6\u6253\u5370 sql \u6267\u884c\u8fc7\u7a0b\uff1f<\/strong><\/p>\n<p>\u4f60\u5728\u8dd1\u5e93\u811a\u672c\u4e2d\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u540e\u53f0\u6267\u884c sql \u811a\u672c\uff0c\u4f1a\u5bfc\u81f4\u811a\u672c\u5361\u6b7b\uff0c\u76f4\u5230 sql \u811a\u672c\u6267\u884c\u5b8c\u6bd5\uff1a<\/p>\n<pre>mysql -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;\" -vvv &gt; ${basepath}\/running_sql.log &amp;\n<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4e3a\u4e86\u5b9e\u65f6\u6253\u5370 sql \u6267\u884c\u8fc7\u7a0b\uff0c\u53ef\u4ee5\u5728  \u547d\u4ee4\u540e\u6dfb\u52a0 -v \u53c2\u6570\u3002\u7136\u800c\uff0c\u5bf9\u4e8e\u4f60\u8fd9\u79cd\u60c5\u51b5\uff0c\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u8fde\u63a5\u91cd\u5b9a\u5411\u4f1a\u66f4\u5408\u9002\uff1a<\/p>\n<pre>mysql -v &lt; ${basepath}\/sql_execute\/apphub\/apphub_mysql_db_create.sql &amp;\nmysql -v &lt; ${basepath}\/sql_execute\/bam\/bam_mysql_db_create.sql &amp;\nmysql -v &lt; ${basepath}\/sql_execute\/bim\/bim_mysql_db_create.sql &amp;\nmysql -v &lt; ${basepath}\/sql_execute\/epass\/epass_mysql_db_create.sql &amp;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u6837\uff0csql \u6267\u884c\u8fc7\u7a0b\u7684\u8f93\u51fa\u4fe1\u606f\u5c06\u76f4\u63a5\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u7ba1\u9053\u6216\u91cd\u5b9a\u5411\u6765\u5904\u7406\u8fd9\u4e9b\u8f93\u51fa\u4fe1\u606f\uff0c\u5b9e\u73b0\u5b9e\u65f6\u6253\u5370\u7684\u529f\u80fd\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u5b9e\u65f6\u6253\u5370 SQL \u6267\u884c\u8fc7\u7a0b\u5e76\u907f\u514d\u811a\u672c\u5361\u6b7b\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 shell \u811a\u672c\u8dd1\u5e93\uff0c\u5e76\u5b9e\u65f6\u6253\u5370 sql \u6267\u884c\u8fc7\u7a0b\uff1f \u4f60\u5728\u8dd1\u5e93\u811a\u672c\u4e2d\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u540e\u53f0\u6267\u884c sql \u811a\u672c\uff0c\u4f1a\u5bfc\u81f4\u811a\u672c\u5361\u6b7b\uff0c\u76f4\u5230 sql \u811a\u672c\u6267\u884c\u5b8c\u6bd5\uff1a mysql -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 apphub${suffix}; source ${basepath}\/sql_execute\/apphub\/apphub_mysql_table_and_data.sql; use bam${suffix}; source ${basepath}\/sql_execute\/bam\/bam_mysql_table_and_data.sql; use bim${suffix}; source ${basepath}\/sql_execute\/bim\/bim_mysql_table_and_data.sql; use epass${suffix}; source ${basepath}\/sql_execute\/epass\/epass_mysql_table_and_data.sql;&#8221; -vvv &gt; ${basepath}\/running_sql.log &amp; \u767b\u5f55\u540e\u590d\u5236 \u4e3a\u4e86\u5b9e\u65f6\u6253\u5370 sql \u6267\u884c\u8fc7\u7a0b\uff0c\u53ef\u4ee5\u5728 \u547d\u4ee4\u540e\u6dfb\u52a0 -v \u53c2\u6570\u3002\u7136\u800c\uff0c\u5bf9\u4e8e\u4f60\u8fd9\u79cd\u60c5\u51b5\uff0c\u4f7f\u7528\u6807\u51c6\u8f93\u51fa\u8fde\u63a5\u91cd\u5b9a\u5411\u4f1a\u66f4\u5408\u9002\uff1a mysql -v &lt; [&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-7412","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7412","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=7412"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7412\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}