{"id":3437,"date":"2014-08-26T15:43:48","date_gmt":"2014-08-26T06:43:48","guid":{"rendered":"http:\/\/blog.papa-net.info\/?page_id=3437"},"modified":"2014-08-26T15:43:48","modified_gmt":"2014-08-26T06:43:48","slug":"%ef%bd%93%ef%bd%91%ef%bd%8c%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bcmysql","status":"publish","type":"page","link":"https:\/\/blog.papa-net.com\/?page_id=3437","title":{"rendered":"\uff33\uff31\uff2c\u30b5\u30fc\u30d0\u30fc(mariadb)"},"content":{"rendered":"<p>\u25c6 MariaDB \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p>CentOS 7 \u3088\u308a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b5\u30fc\u30d0\u30fc\u304c MySQL \u304b\u3089 MariaDB \u306b\u5909\u66f4\u306a\u3063\u305f<\/p>\n<p>#  yum -y install mariadb-server<\/p>\n<p>&nbsp;<\/p>\n<p>\u25c6 \u6587\u5b57\u30b3\u30fc\u30c9\u306e\u8a2d\u5b9a<\/p>\n<p># vi \/etc\/my.cnf.d\/server.cnf<br \/>\n\u9014\u4e2d\u7565<br \/>\n[mysqld]<br \/>\n\u8ffd\u8a18<br \/>\ncharacter-set-server = utf8<br \/>\n\u4ee5\u4e0b\u7565<\/p>\n<p>\u25c6 MariaDB \u306e\u8d77\u52d5<\/p>\n<p>#  systemctl start mariadb<\/p>\n<p>&nbsp;<\/p>\n<p>\u25c6 \u518d\u8d77\u52d5\u306b\u81ea\u52d5\u7684\u306b\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a<\/p>\n<p># systemctl enable mariadb<\/p>\n<p>&nbsp;<\/p>\n<p>\u25c6 \u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\u306e\u78ba\u8a8d<\/p>\n<p>#  systemctl list-unit-files | grep mariadb<br \/>\nmariadb.service                               enabled<br \/>\nenabled \u306b\u306a\u3063\u3066\u3044\u308c\u3070\uff2f\uff2b<\/p>\n<p>&nbsp;<\/p>\n<p>\u25c6 MariaDB \u306e\u8a2d\u5b9a<\/p>\n<p># mysql_secure_installation<\/p>\n<p>****** \u304c\u30d1\u30b9\u30ef\u30fc\u30c9<\/p>\n<p>***** \u306e root \u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\uff08***** \u306f\u30b5\u30fc\u30d0\u30fc\u306e\u30db\u30b9\u30c8\u540d\uff09<\/p>\n<p>mysql&gt; set password for root@&#8217;sentos-server&#8217;=password(&#8216;******&#8217;);<\/p>\n<p>****** \u304c\u30d1\u30b9\u30ef\u30fc\u30c9<\/p>\n<p>127.0.0.1 \u306e root \u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a<\/p>\n<p>mysql&gt; set password for root@&#8217;127.0.0.1&#8217;=password(&#8216;******&#8217;);<\/p>\n<p>****** \u304c\u30d1\u30b9\u30ef\u30fc\u30c9<\/p>\n<p>\u533f\u540d\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664<\/p>\n<p>mysql&gt; delete from mysql.user where user=&#8221;;<\/p>\n<p>\u4e0d\u8981\u306a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u524a\u9664<\/p>\n<p>\uff2d\uff59\uff33\uff31\uff2c\u30b5\u30fc\u30d0\u30fc\u306b\u306f\u6700\u521d\u304b\u3089 test \u3068\u8a00\u3046\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3053\u308c\u3092\u524a\u9664<\/p>\n<p>mysql&gt; drop database test;<\/p>\n<p>\u3053\u3053\u3067\u3044\u3063\u305f\u3093 MySQL \u30b5\u30fc\u30d0\u30fc\u3088\u308a\u30ed\u30b0\u30a2\u30a6\u30c8<\/p>\n<p>mysql&gt; exit<\/p>\n<p>\u518d\u5ea6 MySQL \u30b5\u30fc\u30d0\u30fc\u306b\u30ed\u30b0\u30a4\u30f3<\/p>\n<p>\u4e0a\u8a18\u3067\u8a2d\u5b9a\u3057\u305f\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u30ed\u30b0\u30a4\u30f3<\/p>\n<p># mysql -u root -p<br \/>\nEnter password: ******<\/p>\n<p>****** \u306f\u30d1\u30b9\u30ef\u30fc\u30c9<\/p>\n<p>&nbsp;<\/p>\n<p>\u25c6 \u6587\u5b57\u5316\u3051\u5bfe\u7b56<\/p>\n<p>MySQL5.X\u3067\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u304clatin1\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u30b5\u30fc\u30d0\u30fc\u3084\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u306f\u901a\u5e38 ujis(euc-jp)\u30fbutf8(utf-8) \u306b\u306a\u3063\u3066\u3044 \u308b\u306e\u3067\u30b5\u30fc\u30d0\u30fc\u3084\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u3088\u3063\u3066\u306f\u6587\u5b57\u5316\u3051\u3092\u8d77\u3053\u3059\u306e\u3067\u6587\u5b57\u30b3\u30fc\u30c9\u3092 utf8(utf-8) \u306b\u5909\u66f4\uff08 ujis(euc-jp) \u306b\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f utf8 \u306e\u6240\u3092 ujis \u306b\u8aad\u307f\u66ff\u3048\u308b\uff09<\/p>\n<p>MySQL \u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\/etc\/my.cnf \u3092\u5909\u66f4<\/p>\n<p># vi \/etc\/my.cnf<\/p>\n<p>[mysqld]<br \/>\ndatadir=\/var\/lib\/mysql<br \/>\nsocket=\/var\/lib\/mysql\/mysql.sock<br \/>\nuser=mysql<br \/>\n# Disabling symbolic-links is recommended to prevent assorted security risks<br \/>\nsymbolic-links=0<br \/>\n\u4ee5\u4e0b\u8ffd\u8a18<br \/>\ndefault-character-set=utf8<\/p>\n<p>[mysqld_safe]<br \/>\nlog-error=\/var\/log\/mysqld.log<br \/>\npid-file=\/var\/run\/mysqld\/mysqld.pid<\/p>\n<p>\u4ee5\u4e0b\u8ffd\u8a18<br \/>\n[mysqldump]<br \/>\ndefault-character-set=utf8<\/p>\n<p>[mysql]<br \/>\ndefault-character-set=utf8<\/p>\n<p>&nbsp;<\/p>\n<p>\u25c6 MySQL \u3092\u518d\u8d77\u52d5<\/p>\n<p># \/etc\/rc.d\/init.d\/mysqld restart<\/p>\n<p>&nbsp;<\/p>\n<p>\u25c6 MySQL \u306e\u95a2\u9023\u30bd\u30d5\u30c8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p>php-mysql \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p># yum -y install php-mysql<\/p>\n<p>PHP \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p># yum -y install php<\/p>\n<p>php-mbstring \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p># yum -y install php-mbstring<\/p>\n<p>php-mcrypt \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p># yum -y install php-mcrypt<\/p>\n<p>&nbsp;<\/p>\n<p>*************************<\/p>\n<p><a href=\"?page_id=116\" target=\"_self\" rel=\"noopener\">\u30e1\u30cb\u30e5\u30fc\u306b\u623b\u308b<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u25c6 MariaDB \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb CentOS 7 \u3088\u308a\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b5\u30fc\u30d0\u30fc\u304c MySQL \u304b\u3089 MariaDB \u306b\u5909\u66f4\u306a\u3063\u305f # yum -y install mariadb-server &nbsp; \u25c6 \u6587\u5b57\u30b3\u30fc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":116,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3437","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blog.papa-net.com\/index.php?rest_route=\/wp\/v2\/pages\/3437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.papa-net.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.papa-net.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.papa-net.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.papa-net.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3437"}],"version-history":[{"count":0,"href":"https:\/\/blog.papa-net.com\/index.php?rest_route=\/wp\/v2\/pages\/3437\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/blog.papa-net.com\/index.php?rest_route=\/wp\/v2\/pages\/116"}],"wp:attachment":[{"href":"https:\/\/blog.papa-net.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}