{"id":238287,"date":"2022-04-04T08:12:07","date_gmt":"2022-04-04T00:12:07","guid":{"rendered":"https:\/\/gulass.cn\/?p=238287"},"modified":"2022-03-21T11:14:22","modified_gmt":"2022-03-21T03:14:22","slug":"mariadb-file","status":"publish","type":"post","link":"https:\/\/gulass.cn\/mariadb-file.html","title":{"rendered":"\u8bb0\u4e00\u6b21\u901a\u8fc7\u7269\u7406\u6587\u4ef6\u6062\u590dMariaDB\u6570\u636e"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8fd9\u7bc7\u6587\u7ae0\u6240\u63cf\u8ff0\u7684\u662f\u5728\u6570\u636e\u6587\u4ef6\u5b58\u5728\u7684\u7279\u5b9a\u60c5\u51b5\u4e0b\u8fdb\u884c\u7b80\u5355\u7684\u6570\u636e\u6062\u590d\u3002\u5bf9\u4e8e\u6570\u636e\u6587\u4ef6\u88ab\u5220\u9664\u6389\u7684\u60c5\u51b5\uff0c\u53ef\u80fd\u8981\u8fdb\u884c\u626b\u63cf\u78c1\u76d8\u7b49\u66f4\u4e13\u4e1a\u7684\u64cd\u4f5c\u4e86\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

1\u3001\u8d77\u56e0<\/strong><\/div>\n

\u65f6\u95f4\uff1a2022.03.12 10:10\u3002<\/p>\n

\u4e8b\u4ef6\uff1a\u7f51\u7ad9\u7684 mariadb \u6570\u636e\u5e93 server \u7a81\u7136\u5d29\u6e83\uff0c\u5c1d\u8bd5\u5404\u79cd\u529e\u6cd5\u542f\u52a8\u65e0\u679c\u3002<\/p>\n

\u8fc7\u7a0b\uff1a\u4e0d\u5e78\u7684\u662f\u6570\u636e\u5e93\u6ca1\u6709\u5907\u4efd\uff0c\u4e07\u5e78\u7684\u662f\u53ef\u4ee5\u901a\u8fc7\u6570\u636e\u5e93\u7269\u7406\u6587\u4ef6\u6062\u590d\u6570\u636e\u3002<\/p>\n

\u7ed3\u679c\uff1a\u6062\u590d\u6570\u636e\uff0c\u5e76\u7279\u6b64\u8bb0\u5f55\u6574\u4e2a\u8fc7\u7a0b\uff0c\u4ee5\u5907\u6025\u65f6\u4e4b\u9700\u3002<\/p>\n

2\u3001\u6570\u636e\u5e93\u4e0e\u6570\u636e\u6587\u4ef6<\/strong><\/div>\n

\u4f17\u6240\u5468\u77e5\uff0c\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u4f1a\u4ee5\u6587\u4ef6\u7684\u5f62\u5f0f\u843d\u76d8\u8fdb\u884c\u4fdd\u5b58(\u8fd9\u4e9b\u6587\u4ef6\u662f\u4ee5\u67d0\u79cd\u7279\u5b9a\u683c\u5f0f\u5b58\u50a8\u7684\uff0c\u4e0d\u662ftext\u683c\u5f0f\uff0c\u8bd5\u56fe\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00\u4f1a\u770b\u5230\u4e71\u7801)\u3002\u5728\u6570\u636e\u5e93\u4e2d\uff0c\u6bcf\u4e00\u4e2a database \u90fd\u662f\u4e00\u4e2a\u5355\u72ec\u7684\u6587\u4ef6\u5939\uff0c\u6587\u4ef6\u5939\u4e0b\u5b58\u50a8\u7740\u6bcf\u4e00\u5f20\u8868\u7684\u76f8\u5173\u6587\u4ef6(\u4e0d\u540c\u7684\u5b58\u50a8\u5f15\u64ce\u751f\u6210\u7684\u8868\u6587\u4ef6\u53ef\u80fd\u4e0d\u540c\uff0c\u8fd9\u91cc\u4f7f\u7528 innodb \u5f15\u64ce)\u3002<\/p>\n

\u4f8b\u5982\uff0c\u7b14\u8005\u7f51\u7ad9\u6570\u636e\u5e93\u540d\u79f0\u53eb\u505a ivansli\uff0c\u6709\u4e00\u4e2a\u7528\u6237\u8868 - user\uff0c\u8131\u654f\u4e4b\u540e\u7684\u6570\u636e\u6587\u4ef6\u5e03\u5c40\u5927\u81f4\u5982\u4e0b\uff1a<\/p>\n

\u279c  \/usr\/local\/data tree -L 2                    \r\n.\r\n\u251c\u2500\u2500 aria_log.00000001\r\n\u251c\u2500\u2500 aria_log_control\r\n\u251c\u2500\u2500 ib_buffer_pool\r\n\u251c\u2500\u2500 ibdata1\r\n\u251c\u2500\u2500 ib_logfile0\r\n\u251c\u2500\u2500 ibtmp1\r\n\u251c\u2500\u2500 iZuf63yp8w5ku4znrskda8Z.err\r\n\u251c\u2500\u2500 iZuf63yp8w5ku4znrskda8Z.pid\r\n\u251c\u2500\u2500 multi-master.info\r\n\u251c\u2500\u2500 mysql-bin.000001\r\n\u251c\u2500\u2500 mysql-bin.000002\r\n\u251c\u2500\u2500 mysql-bin.000003\r\n\u251c\u2500\u2500 mysql-bin.index\r\n\u251c\u2500\u2500 mysql-slow.log\r\n\u251c\u2500\u2500 performance_schema\r\n\u2502   \u2514\u2500\u2500 db.opt\r\n\u2514\u2500\u2500 ivansli\r\n    \u251c\u2500\u2500 db.opt\r\n    \u251c\u2500\u2500 user.frm\r\n    \u251c\u2500\u2500 user.MYD\r\n    \u2514\u2500\u2500 user.MYI<\/pre>\n

\u8fd9\u91cc\u7684 \/usr\/local\/data \u6570\u636e\u5e93\u5b58\u50a8\u6570\u636e\u7684\u76ee\u5f55\u3002<\/p>\n

ivansli\u6587\u4ef6\u5939\u4e0b\u53ef\u4ee5\u770b\u5230\u6709\u4e09\u4e2a\u4e0d\u540c\u683c\u5f0f\uff0c\u76f8\u540c\u540d\u79f0\u7684\u6587\u4ef6\uff0c\u4f5c\u7528\u5206\u522b\u4e3a\uff1auser.frm\uff0c\u5b58\u50a8\u6570\u636e\u8868\u7684\u5143\u6570\u636e user.MYD\uff0c\u5b58\u50a8\u6570\u636e\u8868\u7684\u5177\u4f53\u6570\u636e user.MYI\uff0c\u5b58\u50a8\u6570\u636e\u8868\u7684\u7d22\u5f15\u3002<\/p>\n

\u9664\u4e86\u6bcf\u5f20\u8868\u7684\u82e5\u5e72\u4e2a\u6587\u4ef6\u4e4b\u5916\uff0c\u5bf9\u4e8e\u6570\u636e\u5e93server\u6765\u8bf4\u8fd8\u6709\u4e00\u4e2a\u91cd\u8981\u7684 ibdata1 \u6587\u4ef6(\u4f4d\u4e8e\u6570\u636e\u5e93 server \u5b58\u50a8\u6570\u636e\u7684\u6839\u76ee\u5f55)\u3002<\/p>\n

3\u3001 ibdata \u4f5c\u7528<\/strong><\/div>\n

ibdata (\u662fInnoDB\u57fa\u7840\u7ed3\u6784\u7684\u7cfb\u7edf\u8868\u7a7a\u95f4) \u5305\u542b\u51e0\u4e2a\u5bf9InnoDB\u81f3\u5173\u91cd\u8981\u7684\u4fe1\u606f:<\/p>\n

  • \u8868\u683c\u6570\u636e\u9875\u3002<\/li>\n
  • \u8868\u7d22\u5f15\u9875\u3002<\/li>\n
  • \u6570\u636e\u5b57\u5178\u3002<\/li>\n
  • MVCC\u63a7\u5236\u6570\u636e\u3002<\/li>\n
    \u64a4\u6d88\u7a7a\u95f4\u3001\u56de\u6eda\u6bb5<\/strong><\/span><\/div>\n
  • \u53cc\u91cd\u5199\u5165\u7f13\u51b2\u533a(\u5728\u540e\u53f0\u5199\u9875\u9762\u4ee5\u907f\u514d\u64cd\u4f5c\u7cfb\u7edf\u7f13\u5b58)\u3002<\/li>\n
  • \u63d2\u5165\u7f13\u51b2\u533a(\u5bf9\u4e8c\u7ea7\u7d22\u5f15\u7684\u66f4\u6539)\u3002<\/li>\n

    \u7b14\u8005\u8fd9\u91cc innodb_file_per_table=0\uff0c\u4f7f\u7528\u5171\u4eab\u8868\u7a7a\u95f4 ibdata1\uff0c\u6240\u4ee5\u6062\u590d\u6570\u636e\u65f6\u9700\u8981\u62f7\u8d1d\u8fd9\u4e2a\u6587\u4ef6 \u5173\u4e8e\u8fd9\u4e2a\u6587\u4ef6\u5177\u4f53\u53ef\u4ee5\u67e5\u9605\u76f8\u5173\u8d44\u6599\u3002<\/p>\n

    \u5bf9\u4e8e\u7b14\u8005\u6765\u8bf4\uff0c\u867d\u7136 \u6570\u636e\u5e93 server \u6302\u4e86\uff0c\u4f46\u662f\u8fd9\u4e9b\u5173\u952e\u6027\u7684\u6587\u4ef6\u8fd8\u662f\u5b8c\u6574\u7684\u3002\u90a3\u4e48\uff0c\u5c31\u6709\u529e\u6cd5\u901a\u8fc7\u8fd9\u4e9b\u6587\u4ef6\u6765\u6062\u590d\u5bf9\u5e94\u7684\u6570\u636e\u3002<\/p>\n

    \u4e3e\u4e2a\u4e0d\u592a\u6070\u5f53\u7684\u4f8b\u5b50\uff1a<\/p>\n

    \u8fd9\u91cc\u7684\u6570\u636e\u6062\u590d\u6709\u70b9\u50cf\u5668\u5b98\u79fb\u690d\uff0c\u5668\u5b98\u6350\u732e\u8005\u53ef\u80fd\u5df2\u7ecf\u5927\u8111\u6b7b\u4ea1\u3002<\/p>\n

    \u4f46\u662f\u6350\u732e\u8005\u7684\u5fc3\u810f\u7b49\u5668\u5b98\u8fd8\u662f\u6709\u6d3b\u529b\u7684\uff0c\u627e\u5230\u9002\u5408\u7684\u76ee\u6807\u53d7\u4f53\uff0c\u8fd9\u4e9b\u5668\u5b98\u8fd8\u662f\u80fd\u591f\u7ee7\u7eed\u5de5\u4f5c\u7684\u3002<\/p>\n

    4\u3001 \u6062\u590d\u8fc7\u7a0b<\/strong><\/div>\n

    \u8fd9\u91cc\u4ee5 ivansli database \u6570\u636e\u5e93\u7684\u6062\u590d\u4e3a\u4f8b\uff0c\u6574\u4e2a\u6062\u590d\u8fc7\u7a0b\u5927\u81f4\u5982\u4e0b\uff1a<\/p>\n

  • \u67e5\u770b\u5f53\u524d\u5f85\u6062\u590d\u7684\u6570\u636e\u6240\u5728\u7684 server(\u8fd9\u91cc\u79f0\u4e3a \u6e90\u6570\u636e\u5e93server) \u7c7b\u578b\u4ee5\u53ca\u7248\u672c \u7b14\u8005\u8fd9\u91cc\u4f7f\u7528\u7684\u662f mariadb - 10.7.0\u3002<\/li>\n

    \u4e3a\u4ec0\u4e48\u8981\u770b\u5df2\u7ecf crash \u6389\u7684\u6570\u636e\u5e93 server \u7684\u7c7b\u578b\u3001\u7248\u672c\u5462?<\/p>\n

    \u4e3b\u8981\u662f\u4e3a\u6570\u636e\u6062\u590d\u627e\u5230\u4e00\u4e2a\u5339\u914d\u7684\u73af\u5883(\u7c7b\u6bd4\u5668\u5b98\u79fb\u690d\uff0c\u4e5f\u662f\u9700\u8981\u627e\u5230\u76f8\u540c\u3001\u76f8\u8fd1\u7684\u5339\u914d\u53d7\u4f53\uff0c\u5426\u5219\u5c31\u4f1a\u51fa\u95ee\u9898)\u3002<\/p>\n

  • \u5728\u5176\u4ed6\u670d\u52a1\u5668\u642d\u5efa \u4e0e \u6e90\u6570\u636e\u5e93server \u76f8\u540c\u6216\u8005\u76f8\u8fd1\u7248\u672c\u7684 \u6570\u636e\u5e93server (\u8fd9\u91cc\u79f0\u4e3a \u76ee\u6807\u6570\u636e\u5e93server) \u642d\u5efa\u597d\u4e4b\u540e\uff0c\u5148\u628a \u76ee\u6807\u6570\u636e\u5e93server \u505c\u6389\uff0c\u6682\u65f6\u4e0d\u542f\u52a8\uff0c\u4e3a\u540e\u9762\u62f7\u8d1d\u6570\u636e\u505a\u51c6\u5907\u3002<\/li>\n
  • \u628a \u6e90\u6570\u636e\u5e93server \u5f85\u6062\u590d\u7684\u6587\u4ef6\u5939(\u8fd9\u91cc\u662f ivansli \u6587\u4ef6\u5939)\u4e0e ibdata1 \u6587\u4ef6\u62f7\u8d1d\u5230 \u76ee\u6807\u6570\u636e\u5e93server \u6570\u636e\u76ee\u5f55\u4e0b ivansli \u6587\u4ef6\u5939\u5728 \u76ee\u6807\u6570\u636e\u5e93server \u6570\u636e\u5e93\u5b58\u50a8\u6570\u636e\u76ee\u5f55\u4e0b\u4e0d\u5b58\u5728\uff0c\u76f4\u63a5\u62f7\u8d1d\u3002ibdata1 \u6587\u4ef6\u5728 \u76ee\u6807\u6570\u636e\u5e93server \u6570\u636e\u5e93\u5b58\u50a8\u6570\u636e\u76ee\u5f55\u4e0b\u6709\u540c\u540d\u6587\u4ef6\uff0c\u76f4\u63a5\u8986\u76d6\u3002<\/li>\n
  • \u4fee\u6539 \u76ee\u6807\u6570\u636e\u5e93server \u6570\u636e\u5e93\u5b58\u50a8\u6570\u636e\u76ee\u5f55\u4e0b\u76f8\u5173\u6587\u4ef6\u6743\u9650\u3002<\/li>\n
    chmod -R 660 ivansli ibdata1\r\n chown -R mysql:mysql ivansli ibdata1\r\n chmod +x ivansli<\/pre>\n
  • \u542f\u52a8 \u76ee\u6807\u6570\u636e\u5e93server\u3002<\/li>\n
  • \u4f7f\u7528 root \u8d26\u53f7\u767b\u5f55 \u76ee\u6807\u6570\u636e\u5e93server\uff0c\u67e5\u770b\u6570\u636e\u6062\u590d\u60c5\u51b5\u3002<\/li>\n
  • \u76ee\u6807\u6570\u636e\u5e93server\u4e0a \u80fd\u591f\u770b\u5230\u5f85\u6062\u590d\u6570\u636e\uff0c\u505a\u6570\u636e\u5907\u4efd\u5bfc\u51fa\u4fdd\u5b58\u3002<\/li>\n
  • \u5728 \u6e90\u6570\u636e\u5e93server \u670d\u52a1\u5668\u4e0a\u642d\u5efa\u65b0\u7684 \u6570\u636e\u5e93server\uff0c\u628a\u6062\u590d\u7684\u6570\u636e\u5bfc\u5165\u8fdb\u6765\u3002<\/li>\n
    5\u3001 \u603b\u7ed3<\/strong><\/div>\n

    \u5bf9\u4e8e\u5f00\u53d1\u4eba\u5458\u6765\u8bf4\uff0c\u4f1a\u7ecf\u5e38\u542c\u5230\u5220\u5e93\u8dd1\u8def\u3001\u5220\u5e93\u5750\u7262\u4e4b\u7c7b\u7684\u4e8b\u60c5\u53d1\u751f\u3002\u5bf9\u4e8e\u516c\u53f8\u6765\u8bf4\uff0c\u6700\u91cd\u8981\u7684\u662f\u7528\u6237\u7684\u6570\u636e\u4fe1\u606f\uff0c\u5c24\u5176\u662f\u91d1\u878d\u7b49\u884c\u4e1a\uff0c\u5b81\u53ef\u670d\u52a1\u4e0d\u53ef\u7528\uff0c\u6570\u636e\u5b89\u5168\u662f\u4e00\u5b9a\u8981\u4fdd\u8bc1\u7684\u3002<\/p>\n

    \u8fd9\u7bc7\u6587\u7ae0\u6240\u63cf\u8ff0\u7684\u662f\u5728\u6570\u636e\u6587\u4ef6\u5b58\u5728\u7684\u7279\u5b9a\u60c5\u51b5\u4e0b\u8fdb\u884c\u7b80\u5355\u7684\u6570\u636e\u6062\u590d\u3002\u5bf9\u4e8e\u6570\u636e\u6587\u4ef6\u88ab\u5220\u9664\u6389\u7684\u60c5\u51b5\uff0c\u53ef\u80fd\u8981\u8fdb\u884c\u626b\u63cf\u78c1\u76d8\u7b49\u66f4\u4e13\u4e1a\u7684\u64cd\u4f5c\u4e86\u3002<\/p>\n

    \u603b\u4e4b\u4e00\u53e5\u8bdd\uff1a\u5584\u5f85\u6bcf\u4e00\u884c\u4ee3\u7801\uff0c\u8c28\u614e\u6572\u6253\u6bcf\u4e00\u4e2a\u547d\u4ee4\u3002\u8fd8\u6709\u5c31\u662f\uff1a\u505a\u597d\u6570\u636e\u5907\u4efd\u3001\u505a\u597d\u6570\u636e\u5907\u4efd\u3001\u505a\u597d\u6570\u636e\u5907\u4efd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

    \u65f6\u95f4\uff1a2022.03.12 10:10\u3002 \u4e8b\u4ef6\uff1a\u7f51\u7ad9\u7684 mariadb \u6570\u636e\u5e93 server \u7a81\u7136\u5d29\u6e83\uff0c\u5c1d\u8bd5\u5404 […]<\/p>\n","protected":false},"author":1920,"featured_media":85041,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-238287","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/238287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1920"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=238287"}],"version-history":[{"count":2,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/238287\/revisions"}],"predecessor-version":[{"id":238360,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/238287\/revisions\/238360"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/85041"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=238287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=238287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=238287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}