{"id":1869,"date":"2018-01-04T22:04:13","date_gmt":"2018-01-04T13:04:13","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=1869"},"modified":"2018-01-05T04:20:04","modified_gmt":"2018-01-04T19:20:04","slug":"ec2%e3%81%b8%e3%81%aemysql5-7%e3%81%ae%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/1869","title":{"rendered":"EC2\u3078\u306eMySQL5.7\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<h2>1. \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<pre class=\"lang:default highlight:0 decode:true \" >$ sudo yum install mysql57-server<\/pre>\n<h2>2. \u30b5\u30fc\u30d3\u30b9\u81ea\u52d5\u8d77\u52d5\u306e\u8a2d\u5b9a<\/h2>\n<pre class=\"lang:default highlight:0 decode:true \" >$ sudo chkconfig mysqld on<\/pre>\n<h2>3. \u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5<\/h2>\n<pre class=\"lang:default highlight:0 decode:true \" >$ sudo service mysqld start<\/pre>\n<h2>4. \u30c7\u30d5\u30a9\u30eb\u30c8DB\u3078\u306e\u63a5\u7d9a<\/h2>\n<pre class=\"lang:default highlight:0 decode:true \" >$ mysql -u root\r\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\r\nYour MySQL connection id is 4\r\nServer version: 5.7.20 MySQL Community Server (GPL)\r\n\r\nCopyright (c) 2000, 2017, Oracle and\/or its affiliates. All rights reserved.\r\n... \u5f8c\u7565<\/pre>\n<p><!--more--><\/p>\n<h2>5. \u30bb\u30ad\u30e5\u30a2\u306a\u8a2d\u5b9a\u3078\u306e\u5909\u66f4<\/h2>\n<pre class=\"lang:default highlight:0 decode:true \" >$ sudo \/usr\/libexec\/mysql57\/mysql_secure_installation\r\n\r\nSecuring the MySQL server deployment.\r\n\r\nConnecting to MySQL using a blank password.\r\nThe 'validate_password' plugin is installed on the server.\r\nThe subsequent steps will run with the existing configuration\r\nof the plugin.\r\nPlease set the password for root here.\r\n\r\nNew password:\r\n\r\nRe-enter new password:\r\n\r\nEstimated strength of the password: 100\r\nDo you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y\r\nBy default, a MySQL installation has an anonymous user,\r\nallowing anyone to log into MySQL without having to have\r\na user account created for them. This is intended only for\r\ntesting, and to make the installation go a bit smoother.\r\nYou should remove them before moving into a production\r\nenvironment.\r\n\r\nRemove anonymous users? (Press y|Y for Yes, any other key for No) : y\r\nSuccess.\r\n\r\n\r\nNormally, root should only be allowed to connect from\r\n'localhost'. This ensures that someone cannot guess at\r\nthe root password from the network.\r\n\r\nDisallow root login remotely? (Press y|Y for Yes, any other key for No) : y\r\nSuccess.\r\n\r\nBy default, MySQL comes with a database named 'test' that\r\nanyone can access. This is also intended only for testing,\r\nand should be removed before moving into a production\r\nenvironment.\r\n\r\n\r\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : y\r\n - Dropping test database...\r\nSuccess.\r\n\r\n - Removing privileges on test database...\r\nSuccess.\r\n\r\nReloading the privilege tables will ensure that all changes\r\nmade so far will take effect immediately.\r\n\r\nReload privilege tables now? (Press y|Y for Yes, any other key for No) : y\r\nSuccess.\r\n\r\nAll done!<\/pre>\n<p>(\u8a3b) \u30d1\u30b9\u30ef\u30fc\u30c9\u306b\u306f\u7279\u6b8a\u6587\u5b57\u3092\u542b\u3081\u308b\u5fc5\u8981\u3042\u308a\u3002\u3044\u3064\u3082\u306e\u30d1\u30b9\u30ef\u30fc\u30c9 + \u7279\u6b8a\u6587\u5b57\u306e # <\/p>\n<h2>6. \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068DB\u30e6\u30fc\u30b6\u30fc\u306e\u4f5c\u6210<\/h2>\n<pre class=\"lang:default highlight:0 decode:true \" >mysql> CREATE USER database_user@localhost IDENTIFIED by 'database_user_password';\r\nQuery OK, 0 rows affected (0.01 sec)\r\n\r\nmysql> CREATE DATABASE `database4wordpress`;\r\nQuery OK, 1 row affected (0.00 sec)\r\n\r\nmysql> GRANT ALL PRIVILEGES ON `database4wordpress`.* TO database_user@localhost;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nmysql> FLUSH PRIVILEGES;\r\nQuery OK, 0 rows affected (0.00 sec)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb $ sudo yum install mysql57-server 2. \u30b5\u30fc\u30d3\u30b9\u81ea\u52d5\u8d77\u52d5\u306e\u8a2d\u5b9a $ sudo chkconfig mysqld on 3. \u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5 $ sudo servic [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[55,65],"class_list":["post-1869","post","type-post","status-publish","format-standard","hentry","category-memo","tag-aws","tag-mysql"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1869","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=1869"}],"version-history":[{"count":16,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1869\/revisions"}],"predecessor-version":[{"id":1897,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1869\/revisions\/1897"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=1869"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=1869"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=1869"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}