{"id":181605,"date":"2020-05-18T09:16:16","date_gmt":"2020-05-18T01:16:16","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=181605"},"modified":"2020-05-10T16:20:00","modified_gmt":"2020-05-10T08:20:00","slug":"linux-mysql-mariadb","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-mysql-mariadb.html","title":{"rendered":"\u5982\u4f55\u5728Linux\u4e2d\u6267\u884cMySQL\/MariaDB\u67e5\u8be2"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5982\u679c\u60a8\u8d1f\u8d23\u7ba1\u7406\u6570\u636e\u5e93\u670d\u52a1\u5668\uff0c\u5219\u53ef\u80fd\u9700\u8981\u4e0d\u65f6\u8fd0\u884c\u67e5\u8be2\u5e76\u4ed4\u7ec6\u68c0\u67e5\u5b83\u3002\u867d\u7136\u60a8\u53ef\u4ee5\u4eceMySQL\/MariaDB Shell\u6267\u884c\u6b64\u64cd\u4f5c\uff0c\u4f46\u6b64\u6280\u5de7\u5c06\u4f7f\u60a8\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528Linux\u547d\u4ee4\u884c\u6267\u884cMySQL\/MariaDB\u67e5\u8be2\uff0c\u5e76\u5c06\u8f93\u51fa\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\u4ee5\u4f9b\u4ee5\u540e\u68c0\u67e5(\u8fd9\u5728\u67e5\u8be2\u8fd4\u56de\u65f6\u7279\u522b\u6709\u7528\u3002\u5f88\u591a\u8bb0\u5f55)\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8ba9\u6211\u4eec\u6765\u770b\u4e00\u4e9b\u76f4\u63a5\u4ece\u547d\u4ee4\u884c\u8fd0\u884c\u67e5\u8be2\u7684\u7b80\u5355\u793a\u4f8b\uff0c\u7136\u540e\u518d\u8f6c\u5411\u66f4\u9ad8\u7ea7\u7684\u67e5\u8be2\u3002\u8981\u67e5\u770b\u670d\u52a1\u5668\u4e0a\u7684\u6240\u6709\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u53d1\u51fa\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

[linuxidc@localhost\u00a0~\/www.linuxidc.com]$mysql\u00a0-u\u00a0root\u00a0-p\u00a0-e\u00a0\"show\u00a0databases;\"\r\n+--------------------+\r\n|\u00a0Database\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\r\n+--------------------+\r\n|\u00a0idc_db\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\r\n|\u00a0information_schema\u00a0|\r\n|\u00a0linuxidc_db\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\r\n|\u00a0mysql\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\r\n|\u00a0performance_schema\u00a0|\r\n|\u00a0xxx_db\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\r\n+--------------------+<\/pre>\n

\"\"<\/p>\n

\u63a5\u4e0b\u6765\uff0c\u8981\u5728\u6570\u636e\u5e93linuxidc_db \u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3alinuxceshi\u7684\u6570\u636e\u5e93\u8868\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

[linuxidc@localhost\u00a0~\/www.linuxidc.com]$mysql\u00a0-u\u00a0root\u00a0-p\u00a0-e\u00a0\"USE\u00a0linuxidc_db\u00a0;\u00a0CREATE\u00a0TABLE\u00a0linuxceshi(idc_id\u00a0INT\u00a0NOT\u00a0NULL\u00a0AUTO_INCREMENT,\u00a0idc_title\u00a0VARCHAR(100)\u00a0NOT\u00a0NULL,\u00a0idc_author\u00a0VARCHAR(40)\u00a0NOT\u00a0NULL,\u00a0submissoin_date\u00a0DATE,\u00a0PRIMARY\u00a0KEY\u00a0(idc_id));\"<\/pre>\n

\"\"<\/p>\n

\u67e5\u8be2\u4e0b\u8868\u5efa\u597d\u6ca1\u6709<\/p>\n

[linuxidc@localhost\u00a0~\/www.linuxidc.com]$mysql\u00a0-u\u00a0root\u00a0-p\u00a0-e\u00a0\"use\u00a0linuxidc_db;\u00a0desc\u00a0linuxceshi;\"\r\n+-----------------+--------------+------+-----+---------+----------------+\r\n|\u00a0Field\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0Type\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0Null\u00a0|\u00a0Key\u00a0|\u00a0Default\u00a0|\u00a0Extra\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\r\n+-----------------+--------------+------+-----+---------+----------------+\r\n|\u00a0idc_id\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0int(11)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0NO\u00a0\u00a0\u00a0|\u00a0PRI\u00a0|\u00a0NULL\u00a0\u00a0\u00a0\u00a0|\u00a0auto_increment\u00a0|\r\n|\u00a0idc_title\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0varchar(100)\u00a0|\u00a0NO\u00a0\u00a0\u00a0|\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0NULL\u00a0\u00a0\u00a0\u00a0|\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\r\n|\u00a0idc_author\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0varchar(40)\u00a0\u00a0|\u00a0NO\u00a0\u00a0\u00a0|\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0NULL\u00a0\u00a0\u00a0\u00a0|\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\r\n|\u00a0submissoin_date\u00a0|\u00a0date\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0YES\u00a0\u00a0|\u00a0\u00a0\u00a0\u00a0\u00a0|\u00a0NULL\u00a0\u00a0\u00a0\u00a0|\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0|\r\n+-----------------+--------------+------+-----+---------+----------------+<\/pre>\n

\"\"<\/p>\n

\u6211\u4eec\u5c06\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5e76\u5c06\u8f93\u51fa\u901a\u8fc7\u7ba1\u9053\u4f20\u9012\u5230tee\u547d\u4ee4\uff0c\u540e\u8ddf\u8981\u5728\u5176\u4e2d\u5b58\u50a8\u8f93\u51fa\u7684\u6587\u4ef6\u540d\u3002<\/p>\n

\u4e3a\u4e86\u8fdb\u884c\u8bf4\u660e\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u4e2a\u540d\u4e3alinuxidc\u6570\u636e\u5e93\u7684linuxceshi\u8868\u3002\u8bf7\u6ce8\u610f\uff0c\u7cfb\u7edf\u5c06\u63d0\u793a\u60a8\u8f93\u5165\u6570\u636e\u5e93\u7528\u6237\u7684\u5bc6\u7801\uff1a<\/p>\n

[linuxidc@localhost\u00a0~\/www.linuxidc.com]$mysql\u00a0-u\u00a0root\u00a0-p\u00a0-e\u00a0\"use\u00a0linuxidc_db;\u00a0desc\u00a0linuxceshi;\"\u00a0|\u00a0tee\u00a0linuxidc_chaxun.txt<\/pre>\n

\"\"<\/p>\n

\u501f\u52a9cat\u547d\u4ee4\u67e5\u770b\u67e5\u8be2\u7ed3\u679c\u3002<\/p>\n

[linuxidc@localhost\u00a0~\/www.linuxidc.com]$mysql\u00a0-u\u00a0root\u00a0-p\u00a0-e\u00a0\"use\u00a0linuxidc_db;\u00a0desc\u00a0linuxceshi;\"\u00a0|\u00a0tee\u00a0linuxidc_chaxun.txt\r\nEnter\u00a0password:\r\nField\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0\u00a0\u00a0Null\u00a0\u00a0\u00a0\u00a0Key\u00a0\u00a0\u00a0\u00a0Default\u00a0\u00a0\u00a0\u00a0Extra\r\nidc_id\u00a0\u00a0\u00a0\u00a0int(11)\u00a0\u00a0\u00a0\u00a0NO\u00a0\u00a0\u00a0\u00a0PRI\u00a0\u00a0\u00a0\u00a0NULL\u00a0\u00a0\u00a0\u00a0auto_increment\r\nidc_title\u00a0\u00a0\u00a0\u00a0varchar(100)\u00a0\u00a0\u00a0\u00a0NO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0NULL\r\nidc_author\u00a0\u00a0\u00a0\u00a0varchar(40)\u00a0\u00a0\u00a0\u00a0NO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0NULL\r\nsubmissoin_date\u00a0\u00a0\u00a0\u00a0date\u00a0\u00a0\u00a0\u00a0YES\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0NULL\r\n[linuxidc@localhost\u00a0~\/www.linuxidc.com]$cat\u00a0linuxidc_chaxun.txt\r\nField\u00a0\u00a0\u00a0\u00a0Type\u00a0\u00a0\u00a0\u00a0Null\u00a0\u00a0\u00a0\u00a0Key\u00a0\u00a0\u00a0\u00a0Default\u00a0\u00a0\u00a0\u00a0Extra\r\nidc_id\u00a0\u00a0\u00a0\u00a0int(11)\u00a0\u00a0\u00a0\u00a0NO\u00a0\u00a0\u00a0\u00a0PRI\u00a0\u00a0\u00a0\u00a0NULL\u00a0\u00a0\u00a0\u00a0auto_increment\r\nidc_title\u00a0\u00a0\u00a0\u00a0varchar(100)\u00a0\u00a0\u00a0\u00a0NO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0NULL\r\nidc_author\u00a0\u00a0\u00a0\u00a0varchar(40)\u00a0\u00a0\u00a0\u00a0NO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0NULL\r\nsubmissoin_date\u00a0\u00a0\u00a0\u00a0date\u00a0\u00a0\u00a0\u00a0YES\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0NULL<\/pre>\n

\"\"<\/p>\n

\u4f7f\u7528\u7eaf\u6587\u672c\u6587\u4ef6\u7684\u67e5\u8be2\u7ed3\u679c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6\u547d\u4ee4\u884c\u5b9e\u7528\u5de5\u5177\u66f4\u8f7b\u677e\u5730\u5904\u7406\u8bb0\u5f55\u3002<\/p>\n

\u5c0f\u7ed3<\/strong><\/div>\n

\u672c\u6587\u5df2\u7ecf\u5206\u4eab\u4e86\u4e00\u70b9Linux\u6280\u5de7\uff0c\u4f5c\u4e3a\u7cfb\u7edf\u7ba1\u7406\u5458\uff0c\u60a8\u53ef\u4ee5\u5728\u81ea\u52a8\u6267\u884c\u65e5\u5e38Linux\u4efb\u52a1\u6216\u66f4\u8f7b\u677e\u5730\u6267\u884c\u5b83\u4eec\u65b9\u9762\u53d1\u73b0\u6709\u7528\u7684\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u8ba9\u6211\u4eec\u6765\u770b\u4e00\u4e9b\u76f4\u63a5\u4ece\u547d\u4ee4\u884c\u8fd0\u884c\u67e5\u8be2\u7684\u7b80\u5355\u793a\u4f8b\uff0c\u7136\u540e\u518d\u8f6c\u5411\u66f4\u9ad8\u7ea7\u7684\u67e5\u8be2\u3002\u8981\u67e5\u770b\u670d\u52a1\u5668\u4e0a\u7684\u6240\u6709\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u53d1\u51fa\u4ee5\u4e0b […]<\/p>\n","protected":false},"author":323,"featured_media":103595,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-181605","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\/181605","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\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=181605"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181605\/revisions"}],"predecessor-version":[{"id":181646,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181605\/revisions\/181646"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/103595"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=181605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=181605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=181605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}