{"id":456,"date":"2018-09-21T00:53:45","date_gmt":"2018-09-20T15:53:45","guid":{"rendered":"http:\/\/www7390uo.sakura.ne.jp\/wordpress\/?p=456"},"modified":"2022-07-17T11:22:49","modified_gmt":"2022-07-17T02:22:49","slug":"mysql8%e3%81%a7%e3%81%afgrant%e6%a7%8b%e6%96%87%e3%81%a7%e3%83%a6%e3%83%bc%e3%82%b6%e3%82%92%e4%bd%9c%e6%88%90%e3%81%a7%e3%81%8d%e3%81%aa%e3%81%84","status":"publish","type":"post","link":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/archives\/456","title":{"rendered":"MySQL8.0\u3067\u306fGRANT\u69cb\u6587\u3067\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3067\u304d\u306a\u3044"},"content":{"rendered":"\n<p>OS: Ubuntu Server 18.04 LTS<br>MySQL 8.0.12<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><a href=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/09\/mysql8.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/09\/mysql8-300x93.png\" alt=\"\" class=\"wp-image-455\" width=\"300\" height=\"93\" srcset=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/09\/mysql8-300x93.png 300w, https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/09\/mysql8-768x237.png 768w, https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-content\/uploads\/2018\/09\/mysql8.png 901w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption>\u56f31. MySQL\u306e\u30de\u30b9\u30b3\u30c3\u30c8\u3068\u601d\u308f\u308c\u308b\u9ec4\u8272<\/figcaption><\/figure>\n<\/div>\n\n\n<p>MySQL\u306e\u516c\u5f0f\u30b5\u30a4\u30c8\u3067\u3001\u9ec4\u8272\u304f\u3066\u307e\u308b\u3044\u5927\u5909\u306a\u7b11\u9854\u306e\u9ec4\u8272\u304cMySQL8.0\u306e\u767b\u5834\u306b\u89e6\u308c\u3066\u3044\u305f\u306e\u3067\u6b64\u308c\u3092\u30bd\u30fc\u30b9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3002<a href=\"http:\/\/www7390uo.sakura.ne.jp\/wordpress\/archives\/119\">5.7.21\u306e\u30bd\u30fc\u30b9\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u624b\u9806<\/a>\u306f\u5168\u7136\u9055\u308f\u306a\u3044\u3051\u308c\u3069\u3082\u30e6\u30fc\u30b6\u306e\u4f5c\u6210\u304c\u4eca\u307e\u3067\u3068\u7570\u306a\u3063\u3066\u3044\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; grant all on *.* to 'guro'@'localhost' identified by 'avava' with grant option;\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'avava' with grant option' at line 1<\/pre>\n\n\n\n<p>\u3053\u3046\u3044\u3046\u6709\u69d8\u3067\u3042\u308b\u3002GRANT\u69cb\u6587\u3067\u6697\u9ed9\u306e\u3046\u3061\u306b\u30e6\u30fc\u30b6\u3082\u4f5c\u6210\u3059\u308b\u3053\u3068\u306fMySQL5.7\u307e\u3067\u306f\u306a\u3093\u3068\u306a\u304f\u8a31\u3055\u308c\u3066\u3044\u305f\u3051\u308c\u3069\u3082\u3001MySQL8.0\u304b\u3089\u306f\u5bb9\u8d66\u3057\u306a\u3044\u60c5\u52e2\u3067\u3042\u308b\u3002<a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/grant.html#grant-overview\">\u516c\u5f0f\u6587\u732e<\/a>\u3067\u3082\u3001\u666e\u901a\u306fCREATE USER\u69cb\u6587\u3067\u4ee5\u3063\u3066\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u3066\u3001\u7136\u308b\u5f8c\u306bGRANT\u69cb\u6587\u3067\u6a29\u9650\u3092\u4e0e\u3048\u308b\u3068\u3044\u3046\u9806\u756a\u304c\u672c\u5f53\u3067\u3042\u308b\u65e8\u3001\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u3002\u5c24\u3082\u306a\u8a71\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Normally, a database administrator first uses CREATE USER to create an account and define its nonprivilege characteristics such as its password, whether it uses secure connections, and limits on access to server resources, then uses GRANT to define its privileges.<\/p><cite><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/grant.html#grant-overview\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/grant.html#grant-overview<\/a><\/cite><\/blockquote>\n\n\n\n<p>\u3053\u308c\u304b\u3089\u306f\u6b21\u306e\u3088\u3046\u306a\u624b\u7d9a\u304d\u3067\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3057\u3066\u3086\u304f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; create user 'guro'@'localhost' identified by 'avava';\nQuery OK, 0 rows affected (0.14 sec)\n\nmysql&gt; grant all on *.* to 'guro'@'localhost' with grant option;\nQuery OK, 0 rows affected (0.19 sec)\n\nmysql&gt; flush privileges;\nQuery OK, 0 rows affected (0.22 sec)<\/pre>\n\n\n\n<h3 class=\"link\">\u53c2\u8003:<\/h3>\n<ul>\n <li><a href=\"https:\/\/stackoverflow.com\/questions\/50177216\/how-to-grant-all-privileges-to-root-user-in-mysql-8-0\">How to grant all privileges to root user in MySql 8.0<\/a><\/li>\n <li><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/grant.html#grant-overview\">13.7.1.6 GRANT Syntax<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>OS: Ubuntu Server 18.04 LTSMySQL 8.0.12 MySQL\u306e\u516c\u5f0f\u30b5\u30a4\u30c8\u3067\u3001\u9ec4\u8272\u304f\u3066\u307e\u308b\u3044\u5927\u5909\u306a\u7b11\u9854\u306e\u9ec4\u8272\u304cMySQL8.0\u306e\u767b\u5834\u306b\u89e6\u308c\u3066\u3044\u305f\u306e\u3067\u6b64\u308c\u3092\u30bd\u30fc\u30b9\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30025.7.21\u306e\u30bd\u30fc\u30b9\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u624b\u9806\u306f\u5168\u7136\u9055\u308f\u306a\u3044\u3051\u308c\u3069\u3082\u30e6\u30fc\u30b6\u306e\u4f5c\u6210\u304c\u4eca\u307e\u3067\u3068\u7570\u306a\u3063\u3066\u3044\u305f\u3002 mysql&gt; grant all on *.* to &#8216;guro&#8217;@&#8217;localhos &#8230; <a title=\"MySQL8.0\u3067\u306fGRANT\u69cb\u6587\u3067\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3067\u304d\u306a\u3044\" class=\"read-more\" href=\"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/archives\/456\" aria-label=\"MySQL8.0\u3067\u306fGRANT\u69cb\u6587\u3067\u30e6\u30fc\u30b6\u3092\u4f5c\u6210\u3067\u304d\u306a\u3044 \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":966,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[157,162],"tags":[164],"class_list":["post-456","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-162","tag-mysql"],"views":37515,"_links":{"self":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts\/456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/comments?post=456"}],"version-history":[{"count":0,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/posts\/456\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/media\/966"}],"wp:attachment":[{"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/media?parent=456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/categories?post=456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www7390uo.sakura.ne.jp\/wordpress\/wp-json\/wp\/v2\/tags?post=456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}