{"id":3990,"date":"2020-02-17T15:14:32","date_gmt":"2020-02-17T06:14:32","guid":{"rendered":"https:\/\/www.searchlight8.com\/?p=3990"},"modified":"2020-05-31T19:22:11","modified_gmt":"2020-05-31T10:22:11","slug":"centos-7x-mysql-install","status":"publish","type":"post","link":"https:\/\/www.searchlight8.com\/wp-searchlight8\/centos-7x-mysql-install\/","title":{"rendered":"[CentOS 7x] MySQL\u3092CentOS7\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>CentOS7\u304b\u3089\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304cMySQL\u304b\u3089MariaDB\u306b\u5909\u66f4\u3068\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u56de\u306fMariaDB\u3092\u524a\u9664\u3057\u3066\u304b\u3089MySQL\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>MariaDB\u306e\u524a\u9664<\/h3>\n<pre class=\"lang:default decode:true \" ># yum remove mariadb-libs\r\n# rm -rf \/var\/lib\/mysql<\/pre>\n<p>remove mariadb-libs\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u6d88\u53bb\u3057\u3001\u3055\u3089\u306b rm \u3067\u30c7\u30fc\u30bf\u30d5\u30a9\u30eb\u30c0\u3082\u6d88\u53bb\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3092\u884c\u3063\u3066\u304a\u304b\u306a\u3044\u3068\u7af6\u5408\u304c\u8d77\u3053\u308a\u3046\u307e\u304f\u52d5\u304b\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u91cd\u8981\u3067\u3059\u3002<\/p>\n<h3>yum \u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0<\/h3>\n<p><a href=\"https:\/\/dev.mysql.com\/downloads\/repo\/yum\/\"> MySQL Community Downloads<\/a> \u304b\u3089\u6700\u65b0\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u60c5\u5831\u3092\u5165\u624b\u3057\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u300cmysql80-community-release-el7-3.noarch.rpm\u300d\u304c\u6700\u65b0\u7248\u3067\u3057\u305f\u3002<\/p>\n<p> \u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" > rpm -ivh http:\/\/dev.mysql.com\/get\/mysql80-community-release-el7-3.noarch.rpm\r\n\u30d5\u30a1\u30a4\u30eb\u304c\u958b\u3051\u307e\u305b\u3093:  http:\/\/dev.mysql.com\/get\/mysql80-community-release-el8-1.noarch.rpm \u3092\u98db\u3070\u3057\u307e\u3059\u3002\r\n\u4f55\u3082\u3057\u307e\u305b\u3093\r\n<\/pre>\n<p>\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3057\u305f\u3002\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3092\u898b\u306b\u884c\u3063\u305f\u3089\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3068\u3044\u3046\u75c7\u72b6\u3067\u3059\u3002<br \/>\ncurl\u306b\u554f\u984c\u304c\u3042\u308b\u3088\u3046\u306a\u306e\u3067\u3001curl\u306eupdate\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" ># yum update curl<\/pre>\n<p>\u518d\u5ea6\u3001\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c<\/p>\n<pre class=\"lang:default decode:true \" ># rpm -ivh http:\/\/dev.mysql.com\/get\/mysql80-community-release-el7-3.noarch.rpm\r\n\u301c\u7701\u7565\u301c\r\n  \u691c\u8a3c\u4e2d                  : nss-util-3.16.2-1.el7_0.x86_64                                   17\/21 \r\n  \u691c\u8a3c\u4e2d                  : nspr-4.10.6-1.el7_0.x86_64                                       18\/21 \r\n  \u691c\u8a3c\u4e2d                  : nss-3.16.2-2.el7_0.x86_64                                        19\/21 \r\n  \u691c\u8a3c\u4e2d                  : libcurl-7.29.0-19.el7.x86_64                                     20\/21 \r\n  \u691c\u8a3c\u4e2d                  : nss-softokn-3.16.2-1.el7_0.x86_64                                21\/21 \r\n\r\n\u4f9d\u5b58\u6027\u95a2\u9023\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f:\r\n  nss-pem.x86_64 0:1.0.3-7.el7                                                                     \r\n\r\n\u66f4\u65b0:\r\n  curl.x86_64 0:7.29.0-54.el7_7.2                                                                  \r\n\r\n\u4f9d\u5b58\u6027\u3092\u66f4\u65b0\u3057\u307e\u3057\u305f:\r\n  libcurl.x86_64 0:7.29.0-54.el7_7.2           libssh2.x86_64 0:1.8.0-3.el7                       \r\n  nspr.x86_64 0:4.21.0-1.el7                   nss.x86_64 0:3.44.0-7.el7_7                        \r\n  nss-softokn.x86_64 0:3.44.0-8.el7_7          nss-softokn-freebl.x86_64 0:3.44.0-8.el7_7         \r\n  nss-sysinit.x86_64 0:3.44.0-7.el7_7          nss-tools.x86_64 0:3.44.0-7.el7_7                  \r\n  nss-util.x86_64 0:3.44.0-4.el7_7            \r\n\r\n\u5b8c\u4e86\u3057\u307e\u3057\u305f!\r\n<\/pre>\n<pre class=\"lang:default decode:true \" ># cd \/etc\/yum.repos.d\/\r\n# ls\r\n\r\nCentOS-Base.repo       CentOS-Sources.repo  CentOS-fasttrack.repo        mysql-community.repo\r\nCentOS-Debuginfo.repo  CentOS-Vault.repo    mysql-community-source.repo  vz.repo\r\n<\/pre>\n<p>\u4e0a\u8a18\u306b\u300cmysql-community-source.repo  mysql-community.repo\u300d\u306e2\u3064\u304c\u5165\u3063\u3066\u3044\u305f\u306e\u3067\u7121\u4e8b\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\nyum\u306b\u5165\u3063\u3066\u3044\u308b\u30ea\u30dd\u30b8\u30c8\u30ea\u306f\u300c\/etc\/yum.repos.d\/\u300d\u3067\u78ba\u8a8d\u3067\u304d\u308b\u306e\u3067\u899a\u3048\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3059\u306d\u3002<\/p>\n<h3>MySQL\u30b5\u30fc\u30d0\u30fc\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<pre class=\"lang:default decode:true \" >yum install mysql-community-server<\/pre>\n<pre class=\"lang:default decode:true \" ># mysqld --version\r\n\/usr\/sbin\/mysqld  Ver 8.0.19 for Linux on x86_64 (MySQL Community Server - GPL)<\/pre>\n<h3>MySQL\u306e\u8d77\u52d5<\/h3>\n<p> \u8d77\u52d5\u3068\u81ea\u52d5\u8d77\u52d5\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" ># systemctl start mysqld.service\r\n# systemctl enable mysqld.service<\/pre>\n<h3>MySQL\u306e\u521d\u671f\u30d1\u30b9\u30ef\u30fc\u30c9<\/h3>\n<p>MySQL\u306e\u521d\u671f\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u300c\/var\/log\/mysqld.log \u300d\u306e\u4e2d\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" ># cat \/var\/log\/mysqld.log | grep password\r\n2020-02-17T06:05:35.218075Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: J6QwoGl-H+Ml\r\n<\/pre>\n<p>\u3053\u306e\u300cJ6QwoGl-H+Ml\u300d\u304c\u521d\u671f\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<h3>MySQL\u306b\u30ed\u30b0\u30a4\u30f3<\/h3>\n<pre class=\"lang:default decode:true \" ># mysql -u root -p<\/pre>\n<p>\u4e0a\u8a18\u306e\u521d\u671f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3059\u308b\u3068\u3001\u30ed\u30b0\u30a4\u30f3\u304c\u5b8c\u4e86\u3057\u307e\u3059\u3002<\/p>\n<p>MySQL8\u304b\u3089\u306f\u30e6\u30fc\u30b6\u30fc\u306e\u8a8d\u8a3c\u5f62\u5f0f\u304c\u5909\u308f\u3063\u3066\u3044\u307e\u3059\u3002\u65b0\u3057\u3044\u3082\u306e\u3060\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u5834\u5408\u304c\u591a\u3044\u306e\u3067\u3001\u4ee5\u524d\u306e\u3082\u306e\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3059\u308b\u524d\u306b\u3001\u4e0b\u8a18\u306e\u5909\u66f4\u3092\u884c\u3063\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" ># vi \/etc\/my.cnf<\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u3089<br \/>\n[mysqld]<br \/>\ndefault-authentication-plugin=mysql_native_password<br \/>\n\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS7\u304b\u3089\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304cMyS&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2931,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,15],"tags":[225,94],"class_list":["post-3990","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-mysql","tag-linux","tag-mysql","wpcat-14-id","wpcat-15-id"],"_links":{"self":[{"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/posts\/3990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/comments?post=3990"}],"version-history":[{"count":7,"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/posts\/3990\/revisions"}],"predecessor-version":[{"id":5042,"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/posts\/3990\/revisions\/5042"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/media\/2931"}],"wp:attachment":[{"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/media?parent=3990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/categories?post=3990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.searchlight8.com\/wp-searchlight8\/wp-json\/wp\/v2\/tags?post=3990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}