{"id":291371,"date":"2024-05-03T23:09:48","date_gmt":"2024-05-03T15:09:48","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=291371"},"modified":"2024-08-18T15:53:05","modified_gmt":"2024-08-18T07:53:05","slug":"learing-linux-18","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/learing-linux-18.html","title":{"rendered":"\u7b2c18\u7ae0 \u4f7f\u7528MariaDB\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf"},"content":{"rendered":"
\u7ae0\u8282\u7b80\u8ff0\uff1a<\/span><\/strong><\/p>\n \u81ea\u4eceMySQL\u6570\u636e\u5e93\u9879\u76ee\u88abOracle\u516c\u53f8\u6536\u8d2d\u540e\uff0c\u5176\u4ece\u5f00\u6e90\u8f6f\u4ef6\u9010\u6e10\u8f6c\u53d8\u4e3a\u201c\u95ed\u6e90\u201d\u8f6f\u4ef6\uff0c\u8fd9\u4e00\u53d8\u5316\u4fc3\u4f7f\u4f17\u591a\u4f01\u4e1a\u548c\u5382\u5546\u7eb7\u7eb7\u8f6c\u5411MariaDB\u8fd9\u4e00\u65b0\u5174\u7684\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002MariaDB\u51ed\u501f\u5176\u5f00\u6e90\u7279\u6027\u548c\u7a33\u5b9a\u6027\uff0c\u8fc5\u901f\u5360\u636e\u4e86\u5e02\u573a\uff0c\u6210\u4e3aMySQL\u7684\u70ed\u95e8\u66ff\u4ee3\u54c1\u3002<\/p>\n \u672c\u7ae0\u5c06\u9996\u5148\u4ecb\u7ecd\u6570\u636e\u5e93\u53ca\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u7684\u57fa\u672c\u7406\u8bba\u77e5\u8bc6\uff0c\u968f\u540e\u6df1\u5165\u8bb2\u89e3MariaDB\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u7684\u7279\u6027\u548c\u529f\u80fd\u3002\u901a\u8fc7\u52a8\u624b\u5b9e\u9a8c\u7684\u65b9\u5f0f\uff0c\u8bfb\u8005\u5c06\u5b66\u4e60\u5982\u4f55\u5728MariaDB\u4e2d\u8fdb\u884c\u5e38\u89c4\u64cd\u4f5c\uff0c\u5305\u62ec\u7528\u6237\u521b\u5efa\u4e0e\u7ba1\u7406\u3001\u6743\u9650\u6388\u6743\u3001\u65b0\u5efa\u6570\u636e\u5e93\u53ca\u6570\u636e\u5e93\u8868\u3001\u4ee5\u53ca\u6267\u884c\u65b0\u5efa\u3001\u5220\u9664\u3001\u4fee\u6539\u548c\u67e5\u8be2\u7b49\u6570\u636e\u5e93\u64cd\u4f5c\u3002\u6b64\u5916\uff0c\u672c\u7ae0\u8fd8\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u6570\u636e\u5e93\u7684\u5907\u4efd\u4e0e\u6062\u590d\u65b9\u6cd5\uff0c\u786e\u4fdd\u8bfb\u8005\u4e0d\u4ec5\u80fd\u591f\u719f\u7ec3\u638c\u63e1\u201c\u589e\u5220\u6539\u67e5\u201d\u64cd\u4f5c\uff0c\u8fd8\u80fd\u80dc\u4efb\u751f\u4ea7\u73af\u5883\u4e2d\u7684\u6570\u636e\u5e93\u7ba1\u7406\u4e0e\u7ef4\u62a4\u5de5\u4f5c\u3002<\/p>\n \u6570\u636e\u5e93\u662f\u6307\u6309\u7167\u7279\u5b9a\u7ed3\u6784\u5b58\u50a8\u6570\u636e\u7684\u4ed3\u5e93\u3002\u5728\u5927\u6570\u636e\u6280\u672f\u8fc5\u731b\u53d1\u5c55\u7684\u4eca\u5929\uff0c\u4e92\u8054\u7f51\u4e0a\u6bcf\u5929\u90fd\u4f1a\u4ea7\u751f\u6d77\u91cf\u4fe1\u606f\uff0c\u6570\u636e\u5e93\u6280\u672f\u4e5f\u4ece\u6700\u521d\u7684\u7b80\u5355\u8868\u683c\u6570\u636e\u5b58\u50a8\u6a21\u5f0f\uff0c\u53d1\u5c55\u5230\u5982\u4eca\u7684\u5927\u578b\u5206\u5e03\u5f0f\u5b58\u50a8\u6a21\u5f0f\u3002\u6709\u6548\u7ba1\u7406\u548c\u5229\u7528\u8fd9\u4e9b\u6570\u636e\uff0c\u6316\u6398\u5176\u4ef7\u503c\uff0c\u662f\u79d1\u5b66\u7814\u7a76\u548c\u51b3\u7b56\u7ba1\u7406\u7684\u91cd\u8981\u524d\u63d0\u3002\u800c\u6570\u636e\u5e93\u6280\u672f\u5219\u662f\u5404\u7c7b\u4fe1\u606f\u7ba1\u7406\u7cfb\u7edf\u3001\u529e\u516c\u81ea\u52a8\u5316\u7cfb\u7edf\u4ee5\u53ca\u51b3\u7b56\u652f\u6301\u7cfb\u7edf\u7684\u6838\u5fc3\u7ec4\u6210\u90e8\u5206\uff0c\u662f\u6570\u636e\u7ba1\u7406\u4e0e\u5206\u6790\u7684\u5173\u952e\u5de5\u5177\u3002<\/p>\n \u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u662f\u4e00\u79cd\u80fd\u591f\u5bf9\u6570\u636e\u5e93\u4e2d\u5b58\u653e\u7684\u6570\u636e\u8fdb\u884c\u5efa\u7acb\u3001\u4fee\u6539\u3001\u5220\u9664\u3001\u67e5\u627e\u3001\u7ef4\u62a4\u7b49\u64cd\u4f5c\u7684\u8f6f\u4ef6\u7a0b\u5e8f\u3002\u5b83\u901a\u8fc7\u628a\u8ba1\u7b97\u673a\u4e2d\u5177\u4f53\u7684\u7269\u7406\u6570\u636e\u8f6c\u6362\u6210\u9002\u5408\u7528\u6237\u7406\u89e3\u7684\u62bd\u8c61\u903b\u8f91\u6570\u636e\uff0c\u6709\u6548\u5730\u964d\u4f4e\u6570\u636e\u5e93\u7ba1\u7406\u7684\u6280\u672f\u95e8\u69db\uff0c\u56e0\u6b64\u5373\u4fbf\u662f\u4ece\u4e8bLinux\u8fd0\u7ef4\u5de5\u4f5c\u7684\u5de5\u7a0b\u5e08\u4e5f\u53ef\u4ee5\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u57fa\u672c\u7684\u7ba1\u7406\u64cd\u4f5c\u3002\u4f46\u662f\uff0c\u5218\u9044\u8001\u5e08\u6709\u5fc5\u8981\u63d0\u9192\u5404\u4f4d\u8bfb\u8005\uff0c\u672c\u4e66\u7684\u6280\u672f\u4e3b\u7ebf\u4f9d\u7136\u662fLinux\u7cfb\u7edf\u7684\u8fd0\u7ef4\uff0c\u800c\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u53ea\u4e0d\u8fc7\u662f\u5728\u6b64\u4e3b\u7ebf\u4e0a\u7684\u4e00\u4e2a\u5185\u5bb9\u4e0d\u65ad\u6a2a\u5411\u6269\u5c55\u3001\u7eb5\u5411\u52a0\u6df1\u7684\u5206\u652f\uff0c\u4e0d\u80fd\u6307\u671b\u5728\u4e00\u4e24\u5929\u4e4b\u5185\u5c31\u80fd\u7cbe\u901a\u6570\u636e\u5e93\u7ba1\u7406\u6280\u672f\u3002\u5982\u679c\u6709\u8bfb\u8005\u5728\u5b66\u5b8c\u672c\u7ae0\u5185\u5bb9\u4e4b\u540e\u5bf9\u6570\u636e\u5e93\u7ba1\u7406\u6280\u672f\u4ea7\u751f\u4e86\u6d53\u539a\u5174\u8da3\uff0c\u5e76\u5e0c\u671b\u8c0b\u5f97\u4e00\u4efd\u76f8\u5173\u7684\u5de5\u4f5c\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u989d\u5916\u4e3a\u81ea\u5df1\u5236\u5b9a\u8be6\u7ec6\u7684\u8ba1\u5212\u8fdb\u884c\u6df1\u5165\u5b66\u4e60\u4e86\u3002<\/p>\n \u65e2\u7136\u662f\u8bb2\u89e3\u6570\u636e\u5e93\u7ba1\u7406\u6280\u672f\uff0c\u5c31\u5fc5\u7136\u7ed5\u4e0d\u5f00MySQL\u3002MySQL\u4f5c\u4e3a\u5168\u7403\u5e02\u573a\u5360\u6709\u7387\u6781\u9ad8\u7684\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u4ee5\u5176\u6210\u719f\u7684\u6280\u672f\u3001\u7b80\u5355\u7684\u914d\u7f6e\u4ee5\u53ca\u826f\u597d\u7684\u53ef\u6269\u5c55\u6027\u8457\u79f0\u3002\u7136\u800c\uff0c\u7531\u4e8eOracle\u516c\u53f8\u57282009\u5e74\u6536\u8d2d\u4e86MySQL\u7684\u6bcd\u516c\u53f8Sun\uff0c\u56e0\u6b64MySQL\u6570\u636e\u5e93\u9879\u76ee\u4e5f\u968f\u4e4b\u7eb3\u5165Oracle\u9ebe\u4e0b\uff0c\u9010\u6b65\u6f14\u53d8\u4e3a\u4fdd\u6301\u7740\u5f00\u6e90\u8f6f\u4ef6\u7684\u8eab\u4efd\uff0c\u4f46\u53c8\u7533\u8bf7\u4e86\u591a\u9879\u5546\u4e1a\u4e13\u5229\u7684\u8f6f\u4ef6\u7cfb\u7edf\u3002\u5f00\u6e90\u8f6f\u4ef6\u662f\u5168\u7403\u9ed1\u5ba2\u3001\u6781\u5ba2\u3001\u7a0b\u5e8f\u5458\u7b49\u6280\u672f\u9ad8\u624b\u5728\u5f00\u6e90\u793e\u533a\u7684\u5927\u65d7\u4e0b\u7684\u516c\u5171\u667a\u6167\u7684\u7ed3\u6676\uff0c\u81ea\u5df1\u7684\u52b3\u52a8\u6210\u679c\u88ab\u5176\u4ed6\u516c\u53f8\u5546\u4e1a\u5316\u81ea\u7136\u4e5f\u4f24\u4e86\u4e00\u5927\u6279\u5f00\u6e90\u5de5\u4f5c\u8005\u7684\u5fc3\uff0c\u56e0\u6b64MySQL\u9879\u76ee\u7684\u521b\u59cb\u4eba\u91cd\u65b0\u7814\u53d1\u4e86\u4e00\u6b3e\u540d\u4e3aMariaDB\u7684\u5168\u65b0\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002<\/p>\n MariaDB\u548cMySQL\u7684Logo\u5982\u56fe18-1\u6240\u793a\u3002<\/p>\n <\/p>\n \u56fe18-1 MariaDB\u4e0eMysql\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u8457\u540dLOGO<\/p>\n MariaDB\u662f\u7531MySQL\u9879\u76ee\u521b\u59cb\u4ebaMichael Widenius\u5e26\u9886\u7740\u56e2\u961f\u5f00\u53d1\u7684\u3002\u636eMariaDB\u5b98\u7f51\u4ecb\u7ecd\uff0cWidenius\u6709\u4e24\u4e2a\u5973\u513f\uff0c\u5927\u5973\u513f\u540d\u4e3aMy\uff08MySQL\u5f97\u540d\u4e8e\u6b64\uff09\uff0c\u4e8c\u5973\u513f\u540d\u4e3aMaria\uff0c\u56e0\u6b64\u4ed6\u5c06\u8fd9\u6b3e\u65b0\u8f6f\u4ef6\u547d\u540d\u4e3aMariaDB\uff0c\u5ef6\u7eed\u4e86\u5bb6\u65cf\u547d\u540d\u7684\u4f20\u7edf\u3002<\/p>\n MariaDB\u7531\u5f00\u6e90\u793e\u533a\u7ef4\u62a4\uff0c\u662fMySQL\u7684\u5206\u652f\u4ea7\u54c1\uff0c\u800c\u4e14\u4e0eMySQL\u5177\u6709\u9ad8\u5ea6\u7684\u517c\u5bb9\u6027\uff0c\u4e0eMySQL API\u548c\u547d\u4ee4\u5747\u4fdd\u6301\u4e00\u81f4\u3002\u6b64\u5916\uff0cMariaDB\u8fd8\u81ea\u5e26\u4e86\u4e00\u4e2a\u65b0\u7684\u5b58\u50a8\u5f15\u64ceAria\uff0c\u7528\u4e8e\u66ff\u4ee3MyISAM\u3002\u56e0\u6b64\uff0c\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\uff0cMariaDB\u4e0eMySQL\u4e00\u6837\u597d\u7528\u3002<\/p>\n \u4e0e\u6b64\u540c\u65f6\uff0c\u7531\u4e8e\u5404\u5927\u516c\u53f8\u4e4b\u95f4\u5b58\u5728\u7740\u7ade\u4e89\u5173\u7cfb\u6216\u5229\u76ca\u5173\u7cfb\uff0c\u5916\u52a0MySQL\u5728\u88ab\u6536\u8d2d\u4e4b\u540e\u9010\u6e10\u7531\u5f00\u6e90\u5411\u95ed\u6e90\u8f6f\u4ef6\u8f6c\u53d8\uff0c\u5f88\u591a\u516c\u53f8\u629b\u5f03\u4e86MySQL\u3002\u5f53\u524d\uff0c\u8c37\u6b4c\u3001\u7ef4\u57fa\u767e\u79d1\u7b49\u51b3\u5b9a\u5c06MySQL\u6570\u636e\u5e93\u4e0a\u7684\u4e1a\u52a1\u8f6c\u79fb\u5230MariaDB\u6570\u636e\u5e93\uff0cLinux\u5f00\u6e90\u7cfb\u7edf\u7684\u9886\u8896\u7ea2\u5e3d\u516c\u53f8\u4e5f\u51b3\u5b9a\u5728\u6700\u65b0\u7684RHEL\u3001CentOS Stream\u4ee5\u53caFedora\u7cfb\u7edf\u4e2d\uff0c\u5c06MariaDB\u4f5c\u4e3a\u9ed8\u8ba4\u7684\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u800c\u4e14\u7ea2\u5e3d\u516c\u53f8\u66f4\u662f\u5c06\u6570\u636e\u5e93\u77e5\u8bc6\u52a0\u5165\u5230\u4e86RHCE\u8ba4\u8bc1\u7684\u8003\u8bd5\u5185\u5bb9\u4e2d\u3002\u968f\u540e\uff0c\u8fd8\u6709\u6570\u5341\u4e2a\u5e38\u89c1\u7684Linux\u7cfb\u7edf\uff08\u5982openSUSE\u3001Slackware\u7b49\uff09\u4e5f\u505a\u51fa\u4e86\u540c\u6837\u7684\u8868\u6001\u3002<\/p>\n \u5766\u767d\u6765\u8bb2\uff0c\u5c3d\u7ba1IT\u884c\u4e1a\u5de8\u5934\u90fd\u51b3\u5b9a\u91c7\u7528MariaDB\u6570\u636e\u5e93\u7ba1\u7cfb\u7edf\uff0c\u4f46\u8fd9\u5e76\u4e0d\u610f\u5473\u7740MariaDB\u8f83\u4e4b\u4e8eMySQL\u6709\u660e\u663e\u7684\u4f18\u52bf\u3002\u5218\u9044\u8001\u5e08\u7528\u4e86\u8fd1\u4e24\u5468\u7684\u65f6\u95f4\u6d4b\u8bd5\u4e86MariaDB\u4e0eMySQL\u7684\u533a\u522b\uff0c\u5e76\u8fdb\u884c\u4e86\u591a\u9879\u6027\u80fd\u6d4b\u8bd5\uff0c\u5e76\u6ca1\u6709\u53d1\u73b0\u5a92\u4f53\u6240\u8bf4\u7684\u90a3\u79cd\u660e\u663e\u7684\u4f18\u52bf\u3002\u53ef\u4ee5\u8bf4\uff0cMariaDB\u548cMySQL\u5728\u6027\u80fd\u4e0a\u57fa\u672c\u4fdd\u6301\u4e00\u81f4\uff0c\u4e24\u8005\u7684\u64cd\u4f5c\u547d\u4ee4\u4e5f\u5341\u5206\u76f8\u4f3c\u3002\u4ece\u52a1\u5b9e\u7684\u89d2\u5ea6\u6765\u8bb2\uff0c\u5728\u638c\u63e1\u4e86MariaDB\u6570\u636e\u5e93\u7684\u547d\u4ee4\u548c\u57fa\u672c\u64cd\u4f5c\u4e4b\u540e\uff0c\u5728\u672a\u6765\u5de5\u4f5c\u4e2d\u5373\u4f7f\u9047\u5230MySQL\u6570\u636e\u5e93\uff0c\u4e5f\u80fd\u8f7b\u677e\u4e0a\u624b\u3002<\/p>\n \u76f8\u8f83\u4e8eMySQL\uff0cMariaDB\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u6709\u4e86\u5f88\u591a\u65b0\u9c9c\u7684\u6269\u5c55\u7279\u6027\uff0c\u4f8b\u5982\u5bf9\u5fae\u79d2\u7ea7\u522b\u7684\u652f\u6301\u3001\u7ebf\u7a0b\u6c60\u3001\u5b50\u67e5\u8be2\u4f18\u5316\u3001\u8fdb\u7a0b\u62a5\u544a\u7b49\u3002\u5728\u914d\u7f6e\u59a5\u5f53\u8f6f\u4ef6\u4ed3\u5e93\u540e\uff0c\u5373\u53ef\u5b89\u88c5\u90e8\u7f72MariaDB\u6570\u636e\u5e93\u4e3b\u7a0b\u5e8f\u53ca\u670d\u52a1\u7aef\u7a0b\u5e8f\u4e86\u3002<\/p>\n \u5728\u5b89\u88c5\u5b8c\u6bd5\u540e\uff0c\u8bb0\u5f97\u542f\u52a8\u670d\u52a1\u7a0b\u5e8f\uff0c\u5e76\u5c06\u5176\u52a0\u5165\u5230\u5f00\u673a\u542f\u52a8\u9879\u4e2d\uff1a<\/p>\n \u5728\u786e\u8ba4mariadb\u6570\u636e\u5e93\u8f6f\u4ef6\u7a0b\u5e8f\u5b89\u88c5\u5b8c\u6bd5\u5e76\u6210\u529f\u542f\u52a8\u540e\u8bf7\u4e0d\u8981\u7acb\u5373\u4f7f\u7528\u3002\u4e3a\u4e86\u786e\u4fdd\u6570\u636e\u5e93\u7684\u5b89\u5168\u6027\u548c\u6b63\u5e38\u8fd0\u8f6c\uff0c\u9700\u8981\u5148\u5bf9\u6570\u636e\u5e93\u7a0b\u5e8f\u8fdb\u884c\u521d\u59cb\u5316\u64cd\u4f5c\u3002\u8fd9\u4e2a\u521d\u59cb\u5316\u64cd\u4f5c\u6d89\u53ca\u4e0b\u97625\u4e2a\u6b65\u9aa4\u3002<\/p>\n \u8bbe\u7f6eroot\u7ba1\u7406\u5458\u5728\u6570\u636e\u5e93\u4e2d\u7684\u5bc6\u7801\u503c\uff08\u6ce8\u610f\uff0c\u8be5\u5bc6\u7801\u5e76\u975eroot\u7ba1\u7406\u5458\u5728\u7cfb\u7edf\u4e2d\u7684\u5bc6\u7801\uff0c\u8fd9\u91cc\u7684\u5bc6\u7801\u503c\u9ed8\u8ba4\u5e94\u8be5\u4e3a\u7a7a\uff0c\u53ef\u76f4\u63a5\u6309\u56de\u8f66\u952e\uff09\u3002<\/p>\n \u8bbe\u7f6eroot\u7ba1\u7406\u5458\u5728\u6570\u636e\u5e93\u4e2d\u7684\u4e13\u6709\u5bc6\u7801\u3002<\/p>\n \u5220\u9664\u533f\u540d\u7528\u6237\uff0c\u5e76\u4f7f\u7528root\u7ba1\u7406\u5458\u4ece\u8fdc\u7a0b\u767b\u5f55\u6570\u636e\u5e93\uff0c\u4ee5\u786e\u4fdd\u6570\u636e\u5e93\u4e0a\u8fd0\u884c\u7684\u4e1a\u52a1\u7684\u5b89\u5168\u6027\u3002<\/p>\n \u5220\u9664\u9ed8\u8ba4\u7684\u6d4b\u8bd5\u6570\u636e\u5e93\uff0c\u53d6\u6d88\u6d4b\u8bd5\u6570\u636e\u5e93\u7684\u4e00\u7cfb\u5217\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n \u5237\u65b0\u6388\u6743\u5217\u8868\uff0c\u8ba9\u521d\u59cb\u5316\u7684\u8bbe\u5b9a\u7acb\u5373\u751f\u6548\u3002<\/p><\/blockquote>\n \u5bf9\u4e8e\u4e0a\u8ff0\u6570\u636e\u5e93\u521d\u59cb\u5316\u7684\u64cd\u4f5c\u6b65\u9aa4\uff0c\u5728\u8f93\u51fa\u4fe1\u606f\u65c1\u8fb9\u8fdb\u884c\u4e86\u7b80\u5355\u6ce8\u91ca\uff0c\u786e\u4fdd\u5404\u4f4d\u8bfb\u8005\u66f4\u76f4\u89c2\u5730\u4e86\u89e3\u8981\u8f93\u5165\u7684\u5185\u5bb9\uff1a<\/p>\n \u5728\u5f88\u591a\u751f\u4ea7\u73af\u5883\u4e2d\u90fd\u9700\u8981\u4f7f\u7528\u7ad9\u5e93\u5206\u79bb\u7684\u6280\u672f\uff08\u5373\u7f51\u7ad9\u548c\u6570\u636e\u5e93\u4e0d\u5728\u540c\u4e00\u4e2a\u670d\u52a1\u5668\u4e0a\uff09\uff0c\u5982\u679c\u9700\u8981\u8ba9root\u7ba1\u7406\u5458\u8fdc\u7a0b\u8bbf\u95ee\u6570\u636e\u5e93\uff0c\u53ef\u5728\u4e0a\u9762\u7684\u521d\u59cb\u5316\u64cd\u4f5c\u4e2d\u8bbe\u7f6e\u7b56\u7565\uff0c\u4ee5\u5141\u8bb8root\u7ba1\u7406\u5458\u4ece\u8fdc\u7a0b\u8bbf\u95ee\u3002\u7136\u540e\u8fd8\u9700\u8981\u8bbe\u7f6e\u9632\u706b\u5899\uff0c\u4f7f\u5176\u653e\u884c\u5bf9\u6570\u636e\u5e93\u670d\u52a1\u7a0b\u5e8f\u7684\u8bbf\u95ee\u8bf7\u6c42\u3002\u6570\u636e\u5e93\u670d\u52a1\u7a0b\u5e8f\u9ed8\u8ba4\u4f1a\u5360\u75283306\u7aef\u53e3\uff0c\u5728\u9632\u706b\u5899\u7b56\u7565\u4e2d\u670d\u52a1\u540d\u79f0\u7edf\u4e00\u53eb\u4f5cmysql\uff1a<\/p>\n \u4e00\u5207\u51c6\u5907\u5c31\u7eea\u3002\u73b0\u5728\u6211\u4eec\u5c06\u9996\u6b21\u767b\u5f55MariaDB\u6570\u636e\u5e93\u3002\u7ba1\u7406\u6570\u636e\u5e93\u7684\u547d\u4ee4\u4e3amysql\uff0c\u5176\u4e2d\uff0c-u\u53c2\u6570\u7528\u6765\u6307\u5b9a\u4ee5root\u7ba1\u7406\u5458\u7684\u8eab\u4efd\u767b\u5f55\uff0c\u800c-p\u53c2\u6570\u7528\u6765\u9a8c\u8bc1\u8be5\u7528\u6237\u5728\u6570\u636e\u5e93\u4e2d\u7684\u5bc6\u7801\u503c\u3002<\/p>\n \u521d\u6b21\u4f7f\u7528\u6570\u636e\u5e93\u7ba1\u7406\u5de5\u5177\u7684\u8bfb\u8005\uff0c\u53ef\u4ee5\u8f93\u5165help\u547d\u4ee4\u67e5\u770bmariadb\u670d\u52a1\u80fd\u505a\u7684\u64cd\u4f5c\uff0c\u8bed\u53e5\u7684\u7528\u6cd5\u4e0eMySQL\u4e00\u6a21\u4e00\u6837\uff1a<\/p>\n \u5728\u767b\u5f55MariaDB\u6570\u636e\u5e93\u540e\u6267\u884c\u6570\u636e\u5e93\u547d\u4ee4\u65f6\uff0c\u90fd\u9700\u8981\u5728\u547d\u4ee4\u540e\u9762\u7528\u5206\u53f7\uff08;\uff09\u7ed3\u5c3e\uff0c\u8fd9\u4e5f\u662f\u4e0eLinux\u547d\u4ee4\u6700\u663e\u8457\u7684\u533a\u522b\u3002\u5927\u5bb6\u9700\u8981\u6162\u6162\u4e60\u60ef\u6570\u636e\u5e93\u547d\u4ee4\u7684\u8fd9\u79cd\u8bbe\u5b9a\u3002\u4e0b\u9762\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u67e5\u770b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u4e2d\u5f53\u524d\u90fd\u6709\u54ea\u4e9b\u6570\u636e\u5e93\uff1a<\/p>\n \u5c0f\u8bd5\u725b\u5200\u8fc7\u540e\uff0c\u63a5\u4e0b\u6765\u4f7f\u7528\u6570\u636e\u5e93\u547d\u4ee4\u5c06root\u7ba1\u7406\u5458\u5728\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u4e2d\u7684\u5bc6\u7801\u503c\u4fee\u6539\u4e3alinuxprobe\u3002\u8fd9\u6837\u9000\u51fa\u540e\u518d\u5c1d\u8bd5\u767b\u5f55\uff0c\u5982\u679c\u8fd8\u575a\u6301\u8f93\u5165\u539f\u5148\u7684\u5bc6\u7801\uff0c\u5219\u5c06\u63d0\u793a\u8bbf\u95ee\u5931\u8d25\u3002<\/p>\n \u8f93\u5165\u65b0\u5bc6\u7801\uff08linuxprobe\uff09\u540e\uff0c\u4fbf\u53ef\u987a\u5229\u8fdb\u5165\u6570\u636e\u5e93\u7ba1\u7406\u5de5\u5177\u4e2d\uff1a<\/p>\n18.1 \u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf<\/strong><\/span><\/h5>\n
Why is the Software Called MariaDB?\r\n<\/strong>\r\nThe 'MySQL' name is trademarked by Oracle, and they have chosen to keep that trademark to themselves. The name MySQL (just like the MyISAM storage engine) comes from Monty's first daughter My. The first part of 'MySQL' is pronounced like the English adjective, even if this doesn't match the correct pronunciation of the Finnish name.\r\n\r\nMariaDB continues this tradition by being named after his younger daughter, Maria.\r\n\r\nThe name Maria was initially given to a storage engine. After MariaDB was started, to avoid confusion, it was renamed to Aria. The new name was decided as a result of a contest.\r\n<\/pre>\n
18.2 \u521d\u59cb\u5316mariaDB\u670d\u52a1<\/strong><\/span><\/h5>\n
[root@linuxprobe ~]# dnf install -y mariadb mariadb-server\r\nUpdating Subscription Management repositories.\r\nUnable to read consumer identity\r\nThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.\r\nLast metadata expiration check: 0:00:19 ago on Tue 27 Apr 2021 05:04:27 PM CST.\r\nDependencies resolved.\r\n===========================================================================================\r\n Package Arch Version Repository Size\r\n===========================================================================================\r\nInstalling:\r\n mariadb x86_64 3:10.3.11-1.module+el8+2765+cfa4f87b AppStream 6.2 M\r\n mariadb-server x86_64 3:10.3.11-1.module+el8+2765+cfa4f87b AppStream 16 M\r\nInstalling dependencies:\r\n mariadb-common x86_64 3:10.3.11-1.module+el8+2765+cfa4f87b AppStream 62 k\r\n mariadb-connector-c x86_64 3.0.7-1.el8 AppStream 148 k\r\n mariadb-connector-c-config noarch 3.0.7-1.el8 AppStream 13 k\r\n mariadb-errmsg x86_64 3:10.3.11-1.module+el8+2765+cfa4f87b AppStream 232 k\r\n perl-DBD-MySQL x86_64 4.046-2.module+el8+2515+0650e81c AppStream 156 k\r\nInstalling weak dependencies:\r\n mariadb-backup x86_64 3:10.3.11-1.module+el8+2765+cfa4f87b AppStream 6.2 M\r\n mariadb-gssapi-server x86_64 3:10.3.11-1.module+el8+2765+cfa4f87b AppStream 49 k\r\n mariadb-server-utils x86_64 3:10.3.11-1.module+el8+2765+cfa4f87b AppStream 1.6 M\r\nEnabling module streams:\r\n mariadb 10.3 \r\n perl-DBD-MySQL 4.046 \r\n\r\nTransaction Summary\r\n===========================================================================================\r\nInstall 10 Packages\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\nInstalled:\r\n mariadb-3:10.3.11-1.module+el8+2765+cfa4f87b.x86_64 \r\n mariadb-server-3:10.3.11-1.module+el8+2765+cfa4f87b.x86_64 \r\n mariadb-backup-3:10.3.11-1.module+el8+2765+cfa4f87b.x86_64 \r\n mariadb-gssapi-server-3:10.3.11-1.module+el8+2765+cfa4f87b.x86_64 \r\n mariadb-server-utils-3:10.3.11-1.module+el8+2765+cfa4f87b.x86_64 \r\n mariadb-common-3:10.3.11-1.module+el8+2765+cfa4f87b.x86_64 \r\n mariadb-connector-c-3.0.7-1.el8.x86_64 \r\n mariadb-connector-c-config-3.0.7-1.el8.noarch \r\n mariadb-errmsg-3:10.3.11-1.module+el8+2765+cfa4f87b.x86_64 \r\n perl-DBD-MySQL-4.046-2.module+el8+2515+0650e81c.x86_64 \r\n\r\nComplete!<\/pre>\n
[root@linuxprobe ~]# systemctl start mariadb \r\n[root@linuxprobe ~]# systemctl enable mariadb \r\nCreated symlink \/etc\/systemd\/system\/mysql.service \u2192 \/usr\/lib\/systemd\/system\/mariadb.service.\r\nCreated symlink \/etc\/systemd\/system\/mysqld.service \u2192 \/usr\/lib\/systemd\/system\/mariadb.service.\r\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/mariadb.service \u2192 \/usr\/lib\/systemd\/system\/mariadb.service.\r\n<\/pre>\n
[root@linuxprobe ~]# mysql_secure_installation \r\n\r\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\r\n SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!\r\n\r\nIn order to log into MariaDB to secure it, we'll need the current\r\npassword for the root user. If you've just installed MariaDB, and\r\nyou haven't set the root password yet, the password will be blank,\r\nso you should just press enter here.\r\n\r\nEnter current password for root (enter for none): \u8f93\u5165\u7ba1\u7406\u5458\u539f\u59cb\u5bc6\u7801\uff0c\u9ed8\u8ba4\u4e3a\u7a7a\u503c\uff0c\u76f4\u63a5\u56de\u8f66\u5373\u53ef<\/strong>\r\nOK, successfully used password, moving on...\r\n\r\nSetting the root password ensures that nobody can log into the MariaDB\r\nroot user without the proper authorisation.\r\n\r\nSet root password? [Y\/n] y\uff08\u8bbe\u7f6e\u7ba1\u7406\u5458\u5bc6\u7801\uff09<\/strong>\r\nNew password: \u8f93\u5165\u65b0\u7684\u5bc6\u7801<\/strong>\r\nRe-enter new password: \u518d\u6b21\u8f93\u5165\u5bc6\u7801<\/strong>\r\nPassword updated successfully!\r\nReloading privilege tables..\r\n ... Success!\r\n\r\n\r\nBy default, a MariaDB installation has an anonymous user, allowing anyone\r\nto log into MariaDB without having to have a user account created for\r\nthem. This is intended only for testing, and to make the installation\r\ngo a bit smoother. You should remove them before moving into a\r\nproduction environment.\r\n\r\nRemove anonymous users? [Y\/n] y\uff08\u5220\u9664\u533f\u540d\u8d26\u6237\uff09<\/strong>\r\n ... Success!\r\n\r\nNormally, root should only be allowed to connect from 'localhost'. This\r\nensures that someone cannot guess at the root password from the network.\r\n\r\nDisallow root login remotely? [Y\/n] y\uff08\u7981\u6b62\u7ba1\u7406\u5458\u4ece\u8fdc\u7a0b\u767b\u5f55\uff09<\/strong>\r\n ... Success!\r\n\r\nBy default, MariaDB comes with a database named 'test' that anyone can\r\naccess. This is also intended only for testing, and should be removed\r\nbefore moving into a production environment.\r\n\r\nRemove test database and access to it? [Y\/n] y\uff08\u5220\u9664\u6d4b\u8bd5\u6570\u636e\u5e93\u53ca\u5176\u8bbf\u95ee\u6743\u9650\uff09<\/strong>\r\n - Dropping test database...\r\n ... Success!\r\n - Removing privileges on test database...\r\n ... Success!\r\n\r\nReloading the privilege tables will ensure that all changes made so far\r\nwill take effect immediately.\r\n\r\nReload privilege tables now? [Y\/n] y\uff08\u5237\u65b0\u6388\u6743\u8868\uff0c\u8ba9\u521d\u59cb\u5316\u540e\u7684\u8bbe\u5b9a\u7acb\u5373\u751f\u6548\uff09<\/strong>\r\n ... Success!\r\n\r\nCleaning up...\r\n\r\nAll done! If you've completed all of the above steps, your MariaDB\r\ninstallation should now be secure.\r\n\r\nThanks for using MariaDB!\r\n<\/pre>\n
[root@linuxprobe ~]# firewall-cmd --permanent --add-service=mysql\r\nsuccess\r\n[root@linuxprobe ~]# firewall-cmd --reload\r\nsuccess\r\n<\/pre>\n
[root@linuxprobe ~]# mysql -u root -p\r\nEnter password: \u8f93\u5165\u521a\u624d\u8bbe\u7f6e\u7684\u7ba1\u7406\u5458\u5bc6\u7801\u540e\u6572\u51fb\u56de\u8f66<\/strong>\r\nWelcome to the MariaDB monitor. Commands end with ; or \\g.\r\nYour MariaDB connection id is 16\r\nServer version: 10.3.11-MariaDB MariaDB Server\r\n\r\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n<\/pre>\n
MariaDB [(none)]> help\r\n\r\nGeneral information about MariaDB can be found at http:\/\/mariadb.org\r\n\r\nList of all MySQL commands:\r\nNote that all text commands must be first on line and end with ';'\r\n? (\\?) Synonym for `help'.\r\nclear (\\c) Clear the current input statement.\r\nconnect (\\r) Reconnect to the server. Optional arguments are db and host.\r\ndelimiter (\\d) Set statement delimiter.\r\nedit (\\e) Edit command with $EDITOR.\r\nego (\\G) Send command to mysql server, display result vertically.\r\nexit (\\q) Exit mysql. Same as quit.\r\ngo (\\g) Send command to mysql server.\r\nhelp (\\h) Display this help.\r\nnopager (\\n) Disable pager, print to stdout.\r\nnotee (\\t) Don't write into outfile.\r\npager (\\P) Set PAGER [to_pager]. Print the query results via PAGER.\r\nprint (\\p) Print current command.\r\nprompt (\\R) Change your mysql prompt.\r\nquit (\\q) Quit mysql.\r\nrehash (\\#) Rebuild completion hash.\r\nsource (\\.) Execute an SQL script file. Takes a file name as an argument.\r\nstatus (\\s) Get status information from the server.\r\nsystem (\\!) Execute a system shell command.\r\ntee (\\T) Set outfile [to_outfile]. Append everything into given outfile.\r\nuse (\\u) Use another database. Takes database name as argument.\r\ncharset (\\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.\r\nwarnings (\\W) Show warnings after every statement.\r\nnowarning (\\w) Don't show warnings after every statement.\r\n\r\nFor server side help, type 'help contents'\r\n<\/pre>\n
MariaDB [(none)]> SHOW databases;\r\n+--------------------+\r\n| Database |\r\n+--------------------+\r\n| information_schema |\r\n| mysql |\r\n| performance_schema |\r\n+--------------------+\r\n3 rows in set (0.000 sec)\r\n<\/pre>\n
MariaDB [(none)]> SET password = PASSWORD('linuxprobe');\r\nQuery OK, 0 rows affected (0.001 sec)\r\n\r\nMariaDB [(none)]> exit\r\nBye\r\n[root@linuxprobe ~]# mysql -u root -p\r\nEnter password: \u6b64\u5904\u8f93\u5165\u7ba1\u7406\u5458\u5728\u6570\u636e\u5e93\u4e2d\u7684\u65e7\u5bc6\u7801<\/strong>\r\nERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)\r\n<\/pre>\n
[root@linuxprobe ~]# mysql -u root -p\r\nEnter password: \u6b64\u5904\u8f93\u5165\u7ba1\u7406\u5458\u5728\u6570\u636e\u5e93\u4e2d\u7684\u65b0\u5bc6\u7801<\/strong>\r\nWelcome to the MariaDB monitor. Commands end with ; or \\g.\r\nYour MariaDB connection id is 20\r\nServer version: 10.3.11-MariaDB MariaDB Server\r\n\r\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n<\/pre>\n