{"id":9881,"date":"2023-12-09T19:42:48","date_gmt":"2023-12-09T11:42:48","guid":{"rendered":"https:\/\/www.orczhou.com\/?p=9881"},"modified":"2023-12-11T19:43:18","modified_gmt":"2023-12-11T11:43:18","slug":"alibaba-cloud-linux-install-8-2-innovation","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2023\/12\/alibaba-cloud-linux-install-8-2-innovation\/","title":{"rendered":"\u5728Alibaba Cloud Linux\u4e0a\u5b89\u88c5MySQL 8.2\u521b\u65b0\u7248"},"content":{"rendered":"\n<p>\u963f\u91cc\u4e91\u4e3aECS\u63d0\u4f9b\u6700\u65b0\u7248\u672c\u7684\u662fAlibaba Cloud Linux 3\u7cfb\u7edf\uff083.2104 LTS 64\u4f4d\uff09\uff0c\u6839\u636e<a href=\"https:\/\/help.aliyun.com\/zh\/ecs\/user-guide\/release-notes-for-alibaba-cloud-linux\">Release Notes<\/a>\u53ef\u4ee5\u786e\u5b9a\u8fd9\u662f\u4e00\u4e2a\u201cCentOS 8\u3001RHEL 8\u201d\u517c\u5bb9\u7248\uff0c\u5f00\u59cb\u5b89\u88c5\u5427\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. \u4e0b\u8f7d\uff0c\u5e76\u6dfb\u52a0MySQL\u5b98\u65b9Yum\u4ed3\u5e93<\/h4>\n\n\n\n<p>\u4e0b\u8f7d\u65f6\u9009\u62e9<code>Red Hat Enterprise Linux 8<\/code>\u7248\u672c\u5373\u53ef\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"># \u4e0b\u8f7d,Centos 8\u7248\u672c\uff1a\nwget https:\/\/dev.mysql.com\/get\/mysql80-community-release-el8-9.noarch.rpm\n\n# \u5982\u679c\u662f\u4f60 Centos 7\uff0c\u90a3\u4e48\u53ef\u80fd\u662f\u5982\u4e0b\u547d\u4ee4\uff1a\nwget https:\/\/dev.mysql.com\/get\/mysql80-community-release-el7-11.noarch.rpm\n\n# \u5b89\u88c5\u914d\u7f6e\u4ed3\u5e93\uff08Centos 8\uff09\nsudo yum localinstall mysql80-community-release-el8-9.noarch.rpm\n\n# \u786e\u8ba4\u4e0e\u68c0\u67e5\nyum repolist enabled | grep mysql.*-community\nmysql-connectors-community MySQL Connectors Community\nmysql-tools-community      MySQL Tools Community\nmysql80-community          MySQL 8.0 Community Server<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2. \u6253\u5f00\u6216\u5173\u95ed\u9700\u8981\u7684\u5b50\u4ed3\u5e93<\/h4>\n\n\n\n<p>\u5982\u4e0a\u9762\u7684\u8f93\u51fa\uff0c\u53ef\u4ee5\u770b\u5230\uff0c8.0\u7248\u672c\uff08mysql80-community\uff09\u5b50\u4ed3\u5e93\u662f\u9ed8\u8ba4\u6253\u5f00\u7684\u3002\u5982\u679c\u8981\u5b89\u88c58.0\u7248\u672c\uff0c\u5219\u53ef\u4ee5\u8df3\u8fc7\u8fd9\u4e00\u6b65\u4e86\u3002\u4f46\uff0c\u5982\u679c\u8981\u5b89\u88c5\u5176\u4ed6\u7248\u672c\uff0c\u4f8b\u5982\u4f60\u5e0c\u671b\u5b89\u88c5innovation\u7248\u672c\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u5173\u95ed8.0\u4ed3\u5e93\uff0c\u6253\u5f00innovation\u7248\u672c\u5b50\u4ed3\u5e93\u7684\u65b9\u5f0f\u89e3\u51b3\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"># \u67e5\u770b\u6709\u54ea\u4e9b\u5b50\u4ed3\u5e93\uff0c\u4ee5\u53ca\u662f\u5426\u6253\u5f00\nyum repolist all | grep mysql\n\n# \u5982\u679c\u9700\u8981\u7684\u8bdd\uff0c\u53ef\u4ee5\u7981\u75288.0\u5b50\u4ed3\u5e93\uff0c\u6253\u5f00innovation\u7248\u5b50\u4ed3\u5e93\nyum-config-manager --disable mysql80-community\nyum-config-manager --enable mysql-innovation-community\n<\/code><\/pre>\n\n\n\n<p>\u6211\u4eec\u603b\u662f\u53ef\u4ee5\u901a\u8fc7<code>yum repolist<\/code>\u547d\u4ee4\u67e5\u770b\u6240\u6709\u4ed3\u5e93\u7684\u72b6\u6001\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">yum repolist\nyum repolist enabled\nyum repolist disabled<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3. \u5b89\u88c5\u9700\u8981\u7684MySQL-Server\u8f6f\u4ef6<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"># \u67e5\u770b\u4ed3\u5e93\u548c\u7248\u672c\nyum list mysql-community-server\nmysql-community-server.x86_64      8.2.0-1.el8      mysql-innovation-community\n\n# \u5b89\u88c5MySQL 8.2.0\nyum install mysql-community-server\n...\nComplete!<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">4. \u542f\u52a8\u6570\u636e\u5e93<\/h4>\n\n\n\n<p>\u8fd9\u662f\u4e00\u4e2a\u9ed8\u8ba4\u542f\u52a8\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">systemctl start mysqld<\/code><\/pre>\n\n\n\n<p>\u603b\u662f\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4<strong>\u542f\u52a8\/\u5173\u95ed\/\u91cd\u542f\u6216\u67e5\u770b<\/strong>MySQL-Server\u7684\u72b6\u6001\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">systemctl start mysqld\nsystemctl stop mysqld\nsystemctl restart mysqld\nsystemctl status mysqld<\/code><\/pre>\n\n\n\n<p>\u9ed8\u8ba4\u7684\u914d\u7f6e\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">cat \/etc\/my.cnf\n[mysqld]\ndatadir=\/var\/lib\/mysql\nsocket=\/var\/lib\/mysql\/mysql.sock\n\nlog-error=\/var\/log\/mysqld.log\npid-file=\/var\/run\/mysqld\/mysqld.pid<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">5. \u4f7f\u7528root\u8d26\u53f7\u767b\u5f55\u6570\u636e\u5e93<\/h4>\n\n\n\n<p>MySQL\u5728\u542f\u52a8\u65f6\uff0c\u4f1a\u968f\u673a\u751f\u6210\u4e00\u4e2a\u9ed8\u8ba4\u7684root\u5bc6\u7801\uff0c\u9996\u6b21\u767b\u5f55\u9700\u8981\u83b7\u53d6\u8be5\u5bc6\u7801\uff0c\u5e76\u5728\u767b\u5f55\u540e\uff0c\u7acb\u523b\u4fee\u6539\u5bc6\u7801\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">\u83b7\u53d6\u5bc6\u7801\uff1a<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"># \u4ece\u65e5\u5fd7\u6587\u4ef6\u4e2d\u83b7\u53d6\u5bc6\u7801\ngrep 'temporary password' \/var\/log\/mysqld.log\n[Note] [MY-010454] [Server] A temporary password is generated for root@localhost: p!5h)W9DikW\/<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">\u767b\u5f55\u5e76\u4fee\u6539\u5bc6\u7801\uff1a<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"># \u767b\u5f55\nmysql -uroot -p\nEnter password:\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 10\nServer version: 8.2.0\n\nCopyright (c) 2000, 2023, Oracle and\/or its affiliates.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\n# \u4fee\u6539\u9ed8\u8ba4\u7684root\u5bc6\u7801\nmysql&gt; ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">6. \u4e00\u79cd\u4e0d\u5b89\u5168\u3001\u4f46\u662f\u5077\u61d2\u7684\u505a\u6cd5<\/h4>\n\n\n\n<p>\u8fd9\u662f\u4e00\u79cd\u975e\u5e38\u4e0d\u5b89\u5168\u7684\u505a\u6cd5\uff0c\u4f46\u662f\u5f88\u65b9\u4fbf\uff1a\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6(my.cnf)\u4e2d\u65b0\u589e<code>skip-grant-tables=ON<\/code>\uff08<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/server-options.html#option_mysqld_skip-grant-tables\" data-type=\"link\" data-id=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/server-options.html#option_mysqld_skip-grant-tables\">\u53c2\u8003<\/a>\uff09\u6765\u5173\u95edMySQL\u7684\u7528\u6237\u8ba4\u8bc1\u4e0e\u9274\u6743\u4f53\u7cfb\uff0c<strong>\u8c28\u614e\u4f7f\u7528<\/strong>\u3002<\/p>\n\n\n\n<p>\u8fd9\u65f6\u5019\uff0c\u5c31\u53ef\u4ee5\u6ca1\u6709\u4efb\u4f55\u5bc6\u7801\uff0c\u4e0d\u7528\u5173\u6ce8\u4efb\u4f55\u6743\u9650\u53bb\u767b\u5f55\u4e0e\u4f7f\u7528\u6570\u636e\u5e93\u3002\u4e0d\u8fc7\uff0c\u4e3a\u4e86\u5b89\u5168\u8003\u8651\uff0c\u8be5\u53c2\u6570\u6253\u5f00\u540e\uff0c\u6570\u636e\u5e93\u4e5f\u4f1a\u7981\u7528\u6240\u6709\u8fdc\u7a0b\u7684\u8fde\u63a5\uff0c\u4ec5\u5141\u8bb8\u672c\u5730\u7684\u8bbf\u95ee\u3002<\/p>\n\n\n\n<p>EOF<\/p>\n\n\n\n<p>\u53c2\u8003\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/help.aliyun.com\/zh\/ecs\/user-guide\/release-notes-for-alibaba-cloud-linux\" data-type=\"link\" data-id=\"https:\/\/help.aliyun.com\/zh\/ecs\/user-guide\/release-notes-for-alibaba-cloud-linux\">Alibaba Cloud Linux 3\u955c\u50cf\u53d1\u5e03\u8bb0\u5f55<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/linux-installation-yum-repo.html\">Installing MySQL on Linux Using the MySQL Yum Repository<\/a><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u963f\u91cc\u4e91\u4e3aECS\u63d0\u4f9b\u6700\u65b0\u7248\u672c\u7684\u662fAlibaba Cloud Linux 3\u7cfb\u7edf\uff083.2104 LTS 64\u4f4d\uff09\uff0c\u6839\u636eRelease Notes\u53ef\u4ee5\u786e\u5b9a\u8fd9\u662f\u4e00\u4e2a\u201cCentOS 8\u3001RHEL 8\u201d\u517c\u5bb9\u7248\uff0c\u5f00\u59cb\u5b89\u88c5\u5427\u3002 1. \u4e0b\u8f7d\uff0c\u5e76\u6dfb\u52a0MySQL\u5b98\u65b9Yum\u4ed3\u5e93 \u4e0b\u8f7d\u65f6\u9009\u62e9Red Hat Enterprise Linux 8\u7248\u672c\u5373\u53ef\u3002 2. \u6253\u5f00\u6216\u5173\u95ed\u9700\u8981\u7684\u5b50\u4ed3\u5e93 \u5982\u4e0a\u9762\u7684\u8f93\u51fa\uff0c\u53ef\u4ee5\u770b\u5230\uff0c8.0\u7248\u672c\uff08mysql80-community\uff09\u5b50\u4ed3\u5e93\u662f\u9ed8\u8ba4\u6253\u5f00\u7684\u3002\u5982\u679c\u8981\u5b89\u88c58.0\u7248\u672c\uff0c\u5219\u53ef\u4ee5\u8df3\u8fc7\u8fd9\u4e00\u6b65\u4e86\u3002\u4f46\uff0c\u5982\u679c\u8981\u5b89\u88c5\u5176\u4ed6\u7248\u672c\uff0c\u4f8b\u5982\u4f60\u5e0c\u671b\u5b89\u88c5innovation\u7248\u672c\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u5173\u95ed8.0\u4ed3\u5e93\uff0c\u6253\u5f00innovation\u7248\u672c\u5b50\u4ed3\u5e93\u7684\u65b9\u5f0f\u89e3\u51b3\u3002 \u6211\u4eec\u603b\u662f\u53ef\u4ee5\u901a\u8fc7yum repolist\u547d\u4ee4\u67e5\u770b\u6240\u6709\u4ed3\u5e93\u7684\u72b6\u6001\uff1a 3. \u5b89\u88c5\u9700\u8981\u7684MySQL-Server\u8f6f\u4ef6 4. \u542f\u52a8\u6570\u636e\u5e93 \u8fd9\u662f\u4e00\u4e2a\u9ed8\u8ba4\u542f\u52a8\u3002 \u603b\u662f\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u542f\u52a8\/\u5173\u95ed\/\u91cd\u542f\u6216\u67e5\u770bMySQL-Server\u7684\u72b6\u6001\u3002 \u9ed8\u8ba4\u7684\u914d\u7f6e\u6587\u4ef6 5. \u4f7f\u7528root\u8d26\u53f7\u767b\u5f55\u6570\u636e\u5e93 MySQL\u5728\u542f\u52a8\u65f6\uff0c\u4f1a\u968f\u673a\u751f\u6210\u4e00\u4e2a\u9ed8\u8ba4\u7684root\u5bc6\u7801\uff0c\u9996\u6b21\u767b\u5f55\u9700\u8981\u83b7\u53d6\u8be5\u5bc6\u7801\uff0c\u5e76\u5728\u767b\u5f55\u540e\uff0c\u7acb\u523b\u4fee\u6539\u5bc6\u7801\u3002 \u83b7\u53d6\u5bc6\u7801\uff1a \u767b\u5f55\u5e76\u4fee\u6539\u5bc6\u7801\uff1a 6. \u4e00\u79cd\u4e0d\u5b89\u5168\u3001\u4f46\u662f\u5077\u61d2\u7684\u505a\u6cd5 \u8fd9\u662f\u4e00\u79cd\u975e\u5e38\u4e0d\u5b89\u5168\u7684\u505a\u6cd5\uff0c\u4f46\u662f\u5f88\u65b9\u4fbf\uff1a\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6(my.cnf)\u4e2d\u65b0\u589eskip-grant-tables=ON\uff08\u53c2\u8003\uff09\u6765\u5173\u95edMySQL\u7684\u7528\u6237\u8ba4\u8bc1\u4e0e\u9274\u6743\u4f53\u7cfb\uff0c\u8c28\u614e\u4f7f\u7528\u3002 \u8fd9\u65f6\u5019\uff0c\u5c31\u53ef\u4ee5\u6ca1\u6709\u4efb\u4f55\u5bc6\u7801\uff0c\u4e0d\u7528\u5173\u6ce8\u4efb\u4f55\u6743\u9650\u53bb\u767b\u5f55\u4e0e\u4f7f\u7528\u6570\u636e\u5e93\u3002\u4e0d\u8fc7\uff0c\u4e3a\u4e86\u5b89\u5168\u8003\u8651\uff0c\u8be5\u53c2\u6570\u6253\u5f00\u540e\uff0c\u6570\u636e\u5e93\u4e5f\u4f1a\u7981\u7528\u6240\u6709\u8fdc\u7a0b\u7684\u8fde\u63a5\uff0c\u4ec5\u5141\u8bb8\u672c\u5730\u7684\u8bbf\u95ee\u3002 EOF \u53c2\u8003\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[6],"tags":[],"class_list":["post-9881","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/9881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=9881"}],"version-history":[{"count":14,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/9881\/revisions"}],"predecessor-version":[{"id":10296,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/9881\/revisions\/10296"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=9881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=9881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=9881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}