{"id":250713,"date":"2022-08-28T09:26:09","date_gmt":"2022-08-28T01:26:09","guid":{"rendered":"https:\/\/gulass.cn\/?p=250713"},"modified":"2022-08-22T14:27:17","modified_gmt":"2022-08-22T06:27:17","slug":"mysql8-installation-experience","status":"publish","type":"post","link":"https:\/\/gulass.cn\/mysql8-installation-experience.html","title":{"rendered":"MySQL8\uff0c\u4e0d\u4e00\u6837\u7684\u5b89\u88c5\u4f53\u9a8c"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u65f6\u81f3\u4eca\u65e5\uff0cMySQL \u5b98\u5ba3\u5df2\u7ecf\u5bf9\u5916\u5f00\u653e MySQL8 \u7248\u672c\uff0c\u4eca\u5929\u6211\u4eec\u4e00\u8d77\u6765\u4f53\u9a8c\u4e00\u4e0b MySQL8 \u7684\u5b89\u88c5\u65b9\u5f0f\uff01<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u4e00\u3001\u5b89\u88c5\u672c\u5730YUM\u6e90\u3001MySQL<\/strong><\/div>\n

\u5728MySQL\u5b98\u7f51\u4e2d\u4e0b\u8f7dYUM\u6e90rpm\u5b89\u88c5\u5305\u3002<\/p>\n

\"\"<\/p>\n

\r\n#1\u3001\u628a\u4e0a\u9762\u7684rpm\u6587\u4ef6\u4e0b\u8f7d\u4e0b\u6765\u653e\u5230\u670d\u52a1\u5668\u4e0a\r\n#\u6216\u8005\u5728linux\u7cfb\u7edf\u4e2d\u901a\u8fc7wget\u547d\u4ee4\u4e0b\u8f7d\r\nwget http:\/\/dev.mysql.com\/get\/mysql80-community-release-el7-1.noarch.rpm\r\n\r\n#2\u3001\u4e0b\u8f7d\u5b8c\u6210\u540e\u4f7f\u7528yum\u547d\u4ee4\u672c\u5730\u5b89\u88c5yum\u6e90\r\nyum localinstall mysql80-community-release-el7-1.noarch.rpm\r\n\r\n#3\u3001\u6267\u884c\u5b8c\u6bd5\u540e\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u68c0\u67e5\u662f\u5426\u5b89\u88c5\u6210\u529f\r\nyum repolist enabled | grep \"mysql.*-community.*\"\r\n\r\n#4\u3001\u5b89\u88c5\u670d\u52a1\u5668\r\nyum install -y mysql-community-server`<\/pre>\n
\u4e8c\u3001\u914d\u7f6emysql[<\/strong><\/div>\n
2.1\u3001\u670d\u52a1\u547d\u4ee4<\/strong><\/span><\/div>\n
\r\n#\u542f\u52a8MySQL\u670d\u52a1\r\nsystemctl start mysqld\r\n\r\n#\u67e5\u770b\u670d\u52a1\u542f\u52a8\u72b6\u6001\r\nsystemctl status mysqld\r\n\r\n#\u5f00\u673a\u542f\u52a8\r\nsystemctl enable mysqld\r\n\r\n#\u91cd\u65b0\u52a0\u8f7d\u5f00\u673a\u542f\u52a8\u914d\u7f6e\r\nsystemctl daemon-reload<\/pre>\n
2.2\u3001\u4fee\u6539root\u9ed8\u8ba4\u5bc6\u7801<\/strong><\/span><\/div>\n
\r\n#\u67e5\u8be2\u9ed8\u8ba4\u5bc6\u7801\r\ngrep 'temporary password' \/var\/log\/mysqld.log\r\n\r\n#\u767b\u5f55mysql,\u7528\u521a\u624d\u4ece\u6587\u4ef6\u4e2d\u627e\u5230\u7684\u5bc6\u7801\r\nmysql -uroot -p\r\n\r\n#\u5c1d\u8bd5\u4fee\u6539\u5bc6\u7801,\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u4fee\u6539root\u7528\u6237\u7684\u5bc6\u7801\r\nALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '\u4f60\u7684\u5bc6\u7801';\r\n<\/pre>\n
2.3\u3001\u6dfb\u52a0\u8fdc\u7a0b\u767b\u9646<\/strong><\/span><\/div>\n
\r\n#\u521b\u5efa\u4e00\u4e2a\u80fd\u5168\u5c40\u8bbf\u95ee\u7684\u7528\u6237root\r\nCREATE USER 'root'@'%' IDENTIFIED BY \u4f60\u7684\u5bc6\u7801'';\r\n\r\n#\u7ed9\u7528\u6237\u6388\u6743\u4efb\u4f55\u8fdc\u7a0b\u4e3b\u673a\u90fd\u53ef\u4ee5\u8bbf\u95ee\u6570\u636e\u5e93\r\nGRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;\r\n\r\n#\u8f93\u5165\u5237\u65b0\u547d\u4ee4\u4f7f\u4fee\u6539\u751f\u6548\r\nFLUSH PRIVILEGES;<\/pre>\n
2.4\u3001\u4fee\u6539\u5bc6\u7801\u7684\u52a0\u5bc6\u65b9\u5f0f<\/strong><\/span><\/div>\n

\u627e\u5230mysql\u7684\u914d\u7f6e\u6587\u4ef6vim \/etc\/my.cnf\uff0c\u628a\u5bc6\u7801\u7684\u52a0\u5bc6\u65b9\u5f0f\u6539\u6210\u4e4b\u524d\u7248\u672c\u7684,8.0\u7248\u672c\u66f4\u6362\u4e86\u5bc6\u7801\u7684\u52a0\u5bc6\u65b9\u5f0f,\u6211\u4eec\u5c31\u5148\u7528\u65e7\u7684\u3002<\/p>\n

\r\n#\u627e\u5230default-authentication-plugin\uff0c\u5c06\u5176\u6ce8\u91ca\u53d6\u6d88\r\ndefault-authentication-plugin=mysql_native_password\r\n\r\n#\u91cd\u542f\u670d\u52a1\uff0c\u4f7f\u5176\u751f\u6548\r\nsystemctl restart mysqld\r\n<\/pre>\n

\"\"<\/p>\n

2.5\u3001sql_mode=only_full_group_by\u95ee\u9898<\/strong><\/span><\/div>\n
\r\n#\u67e5\u770bsql_mode\r\nselect @@global.sql_mode;\r\n\r\n#\u67e5\u8be2\u51fa\u6765\u7684\u503c\u4e3a\uff1a\r\nONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION<\/pre>\n

\u4fee\u6539my.cnf\uff0c\u5728[mysqld]\u680f\u4e0b\u65b0\u589esql_mode\uff0c\u5c06ONLY_FULL_GROUP_BY\u53bb\u6389\u3002<\/p>\n

\"\"<\/p>\n

\r\n#vim \/etc\/my.cnf\r\nsql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'\r\n\r\n#\u91cd\u542f\u670d\u52a1\r\nsystemctl restart mysqld<\/pre>\n
\u4e09\u3001\u5ba2\u6237\u7aef\u8fde\u63a5\u63a8\u8350<\/strong><\/div>\n
  • Workbench\uff08MySQL \u5b98\u65b9\u5de5\u5177\uff0c\u514d\u8d39\uff0c\u5168\u5e73\u53f0\u652f\u6301\uff09\u3002<\/li>\n
  • SQLyog \uff08\u4ec5\u652f\u6301 Windows\uff0c\u6709\u793e\u533a\u7248\u672c\u548c\u6536\u8d39\u7248\u672c\uff09\u3002<\/li>\n
  • Navicat \uff08\u6536\u8d39\uff0c\u5168\u5e73\u53f0\u652f\u6301\uff09\u3002<\/li>\n
  • Sequel Pro\uff08\u4ec5\u652f\u6301mac\u7248\u672c\uff0c\u5f00\u6e90\uff09\u3002<\/li>\n
    \u56db\u3001\u5c0f\u7ed3<\/strong><\/div>\n

    \u5982\u679c\u4f60\u6b63\u5728\u627e mysql8 \u7684\u5b89\u88c5\u65b9\u5f0f\uff0c\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u5230\u4f60\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

    \u5728MySQL\u5b98\u7f51\u4e2d\u4e0b\u8f7dYUM\u6e90rpm\u5b89\u88c5\u5305\u3002 #1\u3001\u628a\u4e0a\u9762\u7684rpm\u6587\u4ef6\u4e0b\u8f7d\u4e0b\u6765\u653e\u5230\u670d\u52a1\u5668\u4e0a #\u6216\u8005\u5728linux […]<\/p>\n","protected":false},"author":317,"featured_media":108865,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-250713","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\/250713","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\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=250713"}],"version-history":[{"count":2,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/250713\/revisions"}],"predecessor-version":[{"id":250718,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/250713\/revisions\/250718"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/108865"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=250713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=250713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=250713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}