{"id":1470,"date":"2023-01-25T10:00:18","date_gmt":"2023-01-25T01:00:18","guid":{"rendered":"https:\/\/comcent.co.jp\/blog\/?p=1470"},"modified":"2023-02-02T15:53:29","modified_gmt":"2023-02-02T06:53:29","slug":"mysql5-7%e3%81%8b%e3%82%89mysql8-0%e3%81%b8%e3%81%ae%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e7%a7%bb%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/comcent.co.jp\/blog\/archives\/1470\/","title":{"rendered":"MySQL5.7\u304b\u3089MySQL8.0\u3078\u306e\u30b7\u30b9\u30c6\u30e0\u79fb\u884c"},"content":{"rendered":"\n<p>\u5f0a\u793e\u3067\u306f\u793e\u5185\u306b\u3042\u308b\u691c\u8a3c\u7528\u306e\u30b5\u30fc\u30d0\u30fc\u3067\u306fMySQL5.7\u3092\u5229\u7528\u3057\u3066\u591a\u6570\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u904b\u7528\u3057\u3066\u3044\u308b\u3002\u65b0\u898f\u306b\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3061\u4e0a\u3052\u308b\u3079\u304f\u3001MySQL5.7\u306b\u3042\u308b\u30c7\u30fc\u30bf\u3092MySQL8\u74b0\u5883\u3067\u3082\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u79fb\u305d\u3046\u3068\u3057\u305f\u3068\u3053\u308d\u3001\u3044\u308d\u3044\u308d\u3068\u554f\u984c\u304c\u751f\u3058\u305f\u306e\u3067\u3001\u30e1\u30e2\u3002<\/p>\n\n\n\n<p>\u826f\u304f\u3042\u308b\u30d1\u30bf\u30fc\u30f3\u3067\u306f\u3001\u65e2\u306b\u52d5\u3044\u3066\u3044\u308bMySQL5.7\u74b0\u5883\u3092\u305d\u306e\u307e\u307eMySQL8\u306b\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3059\u308b\u3082\u306e\u3067\u3001\u3053\u308c\u306f\u3044\u308d\u3044\u308d\u306a\u4eba\u304c\u6311\u6226\u3057\u60c5\u5831\u3082\u51fa\u305d\u308d\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u3053\u3067\u306f\u89e6\u308c\u306a\u3044\u3002<br>\u3053\u3053\u3067\u89e6\u308c\u308b\u306e\u306f\u3001\u65e2\u306b\u3042\u308bMySQL5.7\u304b\u3089\u30c7\u30fc\u30bf\u3092\u629c\u304d\u51fa\u3057\u3066\u3001\u5225\u30b5\u30fc\u30d0\u30fc\u306b\u3042\u308bMySQL8\u306b\u30c7\u30fc\u30bf\u3092\u5165\u308c\u308b\u3068\u3044\u3046\u65b9\u6cd5\u3067\u3042\u308b\u3002\u307e\u305a\u3001MySQL8\u3092\u65b0\u3057\u3044\u30b5\u30fc\u30d0\u30fc\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002\u4eca\u56de\u306f\u3001Almalinux9\u4e0a\u306bmysql-community-server8.0.30\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002\u4ed8\u968f\u3059\u308bcommunity-common,community-client,community-libs,community-icu-data-fils\u306a\u3069\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304f\u3002<br><br>\u4e00\u5ea6\u8d77\u52d5\u3055\u305b\u3066\u3001mysql_secure_installation\u3092\u5229\u7528\u3057\u3066\u521d\u671f\u8a2d\u5b9a\u3092\u7d42\u308f\u3089\u305b\u3066\u304a\u304f\u3002\u3053\u3053\u307e\u3067\u306f\u901a\u5e38\u901a\u308a\u306eMySQL\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d7\u30ed\u30bb\u30b9\u3002\u3042\u3068\u306f\u3001my.cnf\u3067\u8a2d\u5b9a\u3002\u4eca\u56de\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8a2d\u5b9a\u3092\u3057\u305f\u3002\uff08\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u90e8\u5206\u306f\u5272\u611b\uff09<\/p>\n\n\n\n<pre class=\"modBlobCode\">[mysqld]\nvalidate_password.policy=LOW\ndefault_authentication_plugin=mysql_native_password\ncharacter_set_server = utf8mb4 # \u6587\u5b57\u30b3\u30fc\u30c9\ncollation_server = utf8mb4_ja_0900_as_cs # \u7167\u5408\u9806\u5e8f\n\n# timezone\ndefault-time-zone = SYSTEM\nlog_timestamps = SYSTEM\n\n# Error Log\nlog-error = \/var\/log\/mysql\/mysql-error.log\n\n# Slow Query Log\nslow_query_log = 1\nslow_query_log_file = \/var\/log\/mysql\/mysql-slow.log\nlong_query_time = 1.0\nlog_queries_not_using_indexes = 0\n\n# General Log\ngeneral_log = 1\ngeneral_log_file = \/var\/log\/mysql\/mysql-query.log\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u4e00\u5ea6MySQL\u30b5\u30fc\u30d0\u30fc\u3092\u518d\u8d77\u52d5\u3055\u305b\u3066\u304a\u304f\u3002\u53e4\u3044MySQL5.7\u304b\u3089\u30c7\u30fc\u30bf\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u3066\u304d\u3066\u3001\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308c\u3070\u826f\u3044\u306e\u3067\u3001MySQL5.7\u3067mysqldump\u30b3\u30de\u30f3\u30c9\u3067\u5168\u30c7\u30fc\u30bf\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3002\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u305f\u30c7\u30fc\u30bf\u3092MySQL8\u74b0\u5883\u306b\u30a4\u30f3\u30dd\u30fc\u30c8\u3001\u3001\u3068\u3044\u304d\u305f\u3044\u306e\u3060\u304c\u3001MySQL5.7\u306e\u3068\u304d\u306finformation_schema\u306a\u3069\u306eMySQL\u81ea\u4f53\u304c\u5229\u7528\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304cMyISAM\u3060\u3063\u305f\u304c\u3001MySQL8\u306e\u3068\u304d\u306fInnoDB\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u305d\u306e\u307e\u307e<strong>\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3068MySQL8\u304c\u7834\u58ca\u3055\u308c\u308b<\/strong>\u3002\u4fee\u5fa9\u3059\u308b\u65b9\u6cd5\u3082\u3042\u308b\u3063\u307d\u3044\u304c\u3001\u3069\u308c\u3092\u3084\u3063\u3066\u3082\u4e0a\u624b\u304f\u3044\u304b\u306a\u3044\u306e\u3067\u3001\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u306a\u3044\u306b\u9650\u308b\u3002<\/p>\n\n\n\n<p>mysqldump\u3059\u308b\u3068\u304d\u306b\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001\u5c11\u306a\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u3042\u308c\u3070MySQL\u306e\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u5916\u3057\u3066\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3059\u308c\u3070\u3001\u305d\u306e\u307e\u307e\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u3066\u52d5\u304b\u3059\u3053\u3068\u306f\u53ef\u80fd\u3002\u305f\u3060\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u591a\u3044\u5834\u5408\u306f\u975e\u5e38\u306b\u9762\u5012\u306b\u306a\u308b\u305f\u3081\u3001\u4e00\u5ea6\u5168\u90e8\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u3066\u3001\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u305fSQL\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u3001<\/p>\n\n\n\n<p>performance_schema<br>mysql<br>information_schema<\/p>\n\n\n\n<p>\u306e3\u7a2e\u985e\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304a\u3088\u3073\u305d\u306e\u30c7\u30fc\u30bf\u306e\u307f\u524a\u9664\u3057\u305f\u4e0a\u3067\u3001\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308c\u3070OK\u3002<br>\u901a\u5e38\u306f\u3053\u308c\u3060\u3051\u3067\u79fb\u884c\u304c\u5b8c\u4e86\u3059\u308b\u3002\u307e\u308c\u306b\u30a4\u30f3\u30dd\u30fc\u30c8\u5f8c\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3059\u308b\u306e\u3067\u3001\u305d\u306e\u5834\u5408\u306f\u3001<br>$ sudo mysqld --upgrade=FORCE<br>\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3059\u308b\u3068\u89e3\u6c7a\u3059\u308b\u3002\u3061\u306a\u307f\u306b\u3001mysql_upgrade\u30b3\u30de\u30f3\u30c9\u306f\u5ec3\u6b62\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u4e0a\u8a18\u3092\u5229\u7528\u3059\u308b\u3002<br><br>MySQL8\u306fMySQL5.7\u306b\u6bd4\u3079\u3066\u9ad8\u901f\u306b\u52d5\u4f5c\u3001\u6a5f\u80fd\u306e\u5411\u4e0a\u306a\u3069\u975e\u5e38\u306b\u9b45\u529b\u7684\u306a\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3082\u3042\u308a\u3001\u305d\u306e\u307e\u307e\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3059\u308b\u65b9\u304c\u591a\u3044\u3068\u306f\u601d\u3046\u304c\u3001\u5225\u30b5\u30fc\u30d0\u30fc\u306b\u65b0\u3057\u304f\u7acb\u3061\u4e0a\u3052\u308b\u969b\u306f\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306a\u624b\u9806\u3067\u65e2\u5b58\u30c7\u30fc\u30bf\u3092\u79fb\u3057\u3066\u8cb0\u3048\u3070\u3001\u3068\u601d\u3046\u3002<br><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f0a\u793e\u3067\u306f\u793e\u5185\u306b\u3042\u308b\u691c\u8a3c\u7528\u306e\u30b5\u30fc\u30d0\u30fc\u3067\u306fMySQL5.7\u3092\u5229\u7528\u3057\u3066\u591a\u6570\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u904b\u7528\u3057\u3066\u3044\u308b\u3002\u65b0\u898f\u306b\u30b5\u30fc\u30d0\u30fc\u3092\u7acb\u3061\u4e0a\u3052\u308b\u3079\u304f\u3001MySQL5.7\u306b\u3042\u308b\u30c7\u30fc\u30bf\u3092MySQL8\u74b0\u5883\u3067\u3082\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u79fb\u305d\u3046\u3068\u3057\u305f\u3068\u3053 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":1867,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,14],"tags":[69,125,126,127],"coauthors":[52],"class_list":["post-1470","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","category-backend","tag-mysql","tag-mysql5-7","tag-mysql8","tag-127"],"author_meta":{"nickname":"sekiguchi","position":"CTO","icon_url":"https:\/\/comcent.co.jp\/blog\/images\/authorSk-150x150.png","author_url":"https:\/\/comcent.co.jp\/blog\/archives\/author\/sekiguchi\/"},"tag_names":["MySQL","MySQL5.7","MySQL8","\u30b7\u30b9\u30c6\u30e0\u79fb\u884c"],"thumbnail_url":"https:\/\/comcent.co.jp\/blog\/wp-content\/uploads\/2022\/03\/blogmysql-300x200.jpg","_links":{"self":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=1470"}],"version-history":[{"count":6,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1470\/revisions"}],"predecessor-version":[{"id":1567,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1470\/revisions\/1567"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/media\/1867"}],"wp:attachment":[{"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=1470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=1470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=1470"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/comcent.co.jp\/blog\/wp-json\/wp\/v2\/coauthors?post=1470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}