{"id":7828,"date":"2022-03-29T10:48:21","date_gmt":"2022-03-29T02:48:21","guid":{"rendered":"https:\/\/blog.ywdevops.cn\/?p=7828"},"modified":"2022-03-29T10:48:21","modified_gmt":"2022-03-29T02:48:21","slug":"mysql-7","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2022\/03\/29\/mysql-7\/","title":{"rendered":"MySQL\u5347\u7ea7"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">mysql\u5b89\u88c5\u5305\u4e0b\u8f7d\u5730\u5740\uff1a<a href=\"https:\/\/downloads.mysql.com\/archives\/community\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/downloads.mysql.com\/archives\/community\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6559\u7a0b\u4e2d\u6f14\u793amysql\u4ece5.7.19\u5347\u7ea7\u52305.7.35\uff0c \u8bf4\u660e\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>\u4e00\u3001\u5347\u7ea7\u6b65\u9aa4\uff1a<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u9996\u5148\u67e5\u770b\u5f53\u524dMySQL\u7684\u7248\u672c\u4fe1\u606f\uff0c\u6267\u884c\u547d\u4ee4myql -V\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"86\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/9-5.png\" alt=\"\" class=\"wp-image-7832\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/9-5.png 710w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/9-5-300x36.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/9-5-600x73.png 600w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u5907\u4efd\u6240\u6709\u6570\u636e\u5e93\uff0c\u6267\u884c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysqldump -u root -p --all-databases > alldatabases.sql<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u505c\u6b62\u8fd0\u884c\u4e2d\u7684MySQL\uff0c\u6267\u884c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/init.d\/mysqld stop<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001\u5907\u4efd\u65e7\u7684mysql\u7684bin\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/usr\/bin &amp;&amp;    tar -zcvf mysql.tgz mysql      #\u5c06mysql\u4e8c\u8fdb\u5236\u6587\u4ef6\u6253\u5305\ncd \/usr\/local\/mysql  &amp;&amp;  tar -zcvf bin.tgz bin   #\u5c06bin\u76ee\u5f55\u6253\u5305\ncd \/etc\/init.d\/      &amp;&amp;  tar -zcvf mysqld.tgz mysqld<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001\u5c06\u65b0\u7684mysql\u5305\u89e3\u538b\uff0c\u5e76\u5c06\u89e3\u538b\u540e\u7684bin\u76ee\u5f55\u590d\u5236\u5230\u65e7\u7684\u76ee\u5f55\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -xf mysql-5.7.35-linux-glibc2.12-x86_64.tgz\n\\cp mysql-5.7.35-linux-glibc2.12-x86_64\/bin   \/usr\/local\/mysql     #\u8986\u76d6\u65e7\u7684mysql\u7684bin\u76ee\u5f55\n\\cp mysql-5.7.35-linux-glibc2.12-x86_64\/bin\/mysql  \/usr\/bin\/mysql  #\u8986\u76d6mysql\n\\cp mysql-5.7.35-linux-glibc2.12-x86_64\/support-files\/mysql.server  \/etc\/init.d\/mysqld  #\u8986\u76d6mysqld\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">6\u3001\u4fee\u6539mysqld\u4e2d\u7684\u57fa\u7840\u76ee\u5f55\u548c\u6570\u636e\u76ee\u5f55\u4f4d\u7f6e\uff0c\u6309\u7167\/etc\/my.cnf\u4e2d\u7684\u4fee\u6539\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"713\" height=\"109\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/10-6.png\" alt=\"\" class=\"wp-image-7837\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/10-6.png 713w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/10-6-300x46.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/10-6-600x92.png 600w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">7\u3001\u4fee\u6539\u5b8c\u6210\u540e\uff0c\u542f\u52a8mysql\uff0c\u6267\u884c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/init.d\/mysqld start<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"150\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/11-5.png\" alt=\"\" class=\"wp-image-7840\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/11-5.png 710w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/11-5-300x63.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/11-5-600x127.png 600w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">8\u3001\u518d\u6b21\u67e5\u770bmysql\u7248\u672c\uff0c\u5df2\u7ecf\u5347\u7ea7\u5230\u4e865.7.35\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"76\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/12-3.png\" alt=\"\" class=\"wp-image-7842\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/12-3.png 706w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/12-3-300x32.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/03\/12-3-600x65.png 600w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">9\u3001\u6700\u540e\u6267\u884cmysql_upgrade\u8fdb\u884c\u68c0\u67e5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql_upgrade -uroot -p --force --skip-version-check -S \/tmp\/mysql.sock<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>mysql\u5b89\u88c5\u5305\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/downloads.mysql.com\/archives\/commu [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":7846,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35,25],"tags":[],"class_list":["post-7828","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql","category-database"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/7828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=7828"}],"version-history":[{"count":13,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/7828\/revisions"}],"predecessor-version":[{"id":7845,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/7828\/revisions\/7845"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/7846"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=7828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=7828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=7828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}