{"id":3840,"date":"2020-03-01T20:48:11","date_gmt":"2020-03-01T11:48:11","guid":{"rendered":"https:\/\/akamist.com\/blog\/?p=3840"},"modified":"2020-03-09T17:30:00","modified_gmt":"2020-03-09T08:30:00","slug":"vagrantcentos8-1%e3%81%a7mysql8-0%e3%81%8c%e3%81%99%e3%81%90%e3%81%ab%e5%88%a9%e7%94%a8%e5%8f%af%e8%83%bd%e3%81%aavagrantfile","status":"publish","type":"post","link":"https:\/\/akamist.com\/blog\/archives\/3840","title":{"rendered":"[Vagrant]CentOS8.1\u3067MySQL8.0\u304c\u3059\u3050\u306b\u5229\u7528\u53ef\u80fd\u306aVagrantfile"},"content":{"rendered":"<p>vagrant up\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3001CentOS8.1\u3067MySQL8.0\u304c\u3059\u3050\u306b\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308bVagrantfile\u3067\u3059\u3002(macOS\u3067\u52d5\u4f5c\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059)<\/p>\n<pre><code class=\"language-ruby\"># -*- mode: ruby -*-\n# vi: set ft=ruby :\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"bento\/centos-8.1\"\n  config.vm.box_check_update = false\n  config.vm.network \"forwarded_port\", guest: 3306, host: 3306\n  #config.vm.synced_folder \"..\/data\", \"\/vagrant_data\"\n\n  #config.vm.provider \"virtualbox\" do |vb|\n  #   vb.gui = true\n  #   vb.memory = \"1024\"\n  #end\n\n  config.vm.provision \"shell\", inline: &lt;&lt;-SHELL\n    # install MySQL server.\n    sudo yum install mysql-server -y\n\n    # start and enable mysqld.\n    systemctl start mysqld\n    systemctl enable --now mysqld\n    systemctl status mysqld\n\n    # add grant through vagrant gateway\n    mysql -u root -e \"create user 'root'@'_gateway' identified by '';\"\n\n    # check version.\n    mysql --user=root --password='' --execute 'select version();'\n  SHELL\nend\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u305f\u4e0a\u3067\u3001'vagrant up'\u3059\u308b\u3060\u3051\u3067\u3001MySQL8.0.x\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u306eVM\u304c\u30ed\u30fc\u30ab\u30eb\u3067\u8d77\u52d5\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u8d77\u52d5\u5f8c\u306f\u30db\u30b9\u30c8OS\u304b\u3089\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u3067\u30b5\u30fc\u30d0\u306b\u63a5\u7d9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">$ mysql --host=127.0.0.1 --user=root --password='' --execute 'select version();'\nmysql: [Warning] Using a password on the command line interface can be insecure.\n+-----------+\n| version() |\n+-----------+\n| 8.0.17    |\n+-----------+\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>vagrant up\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u3001CentOS8.1\u3067MySQL8.0\u304c\u3059\u3050\u306b\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308bVagrantfile\u3067\u3059\u3002(macOS\u3067\u52d5\u4f5c\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059) # -*- mode: ruby -*- #  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":729,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23,72,167],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/akamist.com\/blog\/wp-content\/uploads\/2017\/10\/icon_vagrant.png","jetpack-related-posts":[{"id":945,"url":"https:\/\/akamist.com\/blog\/archives\/945","url_meta":{"origin":3840,"position":0},"title":"[Vagrant]CentOS7.3+MySQL5.6\u74b0\u5883\u3092\u30b3\u30de\u30f3\u30c91\u3064\u3067\u69cb\u7bc9\u3059\u308b","date":"2017\u5e7411\u670812\u65e5","format":false,"excerpt":"\u4e0b\u8a18\u306e\u5185\u5bb9\u3067Vagrantfile\u3092\u4f5c\u6210\u3057\u3066\u3001'vagrant up'\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308c\u3070\u3001MySQ\u2026","rel":"","context":"Linux","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2017\/10\/icon_vagrant.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2553,"url":"https:\/\/akamist.com\/blog\/archives\/2553","url_meta":{"origin":3840,"position":1},"title":"[Vagrant]AmazonLinux + MySQL5.7 + \bsakila DB\u304c\u4f7f\u3048\u308b\u74b0\u5883\u3092\u30b3\u30de\u30f3\u30c91\u3064\u3067\u69cb\u7bc9\u3059\u308b","date":"2018\u5e744\u670829\u65e5","format":false,"excerpt":"\u65b0\u3057\u3044\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e\u3084\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u5b66\u3076\u6642\u3001\u9069\u5f53\u306a\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u304c\u5165\u3063\u305fMySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u6b32\u2026","rel":"","context":"aws","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2017\/10\/icon_vagrant.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2639,"url":"https:\/\/akamist.com\/blog\/archives\/2639","url_meta":{"origin":3840,"position":2},"title":"[NLP]Vagrant\u3067Python3\u304b\u3089MeCab\u4f7f\u3048\u308b\u74b0\u5883\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7","date":"2018\u5e745\u67085\u65e5","format":false,"excerpt":"AmazonLinux\u3067\u3001Python3\u304b\u3089\u5f62\u614b\u7d20\u89e3\u6790\u30e9\u30a4\u30d6\u30e9\u30ea\u306eMeCab\u3092\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u30bb\u30c3\u30c8\u30a2\u2026","rel":"","context":"MeCab","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2018\/05\/icon_mecab.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":946,"url":"https:\/\/akamist.com\/blog\/archives\/946","url_meta":{"origin":3840,"position":3},"title":"[Vagrant]mysql\u306b\u63a5\u7d9a\u6642\u3001Host 'gateway' is not allowed\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3068\u304d","date":"2017\u5e7411\u670812\u65e5","format":false,"excerpt":"Vagrant\u3067MySQL\u3092\u8d77\u52d5\u3055\u305b\u30663306\u306e\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u884c\u3063\u3066\u3044\u308b\u3068\u304d\u306b\u3001\u30db\u30b9\u30c8OS\u2026","rel":"","context":"Linux","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2017\/10\/icon_vagrant.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":520,"url":"https:\/\/akamist.com\/blog\/archives\/520","url_meta":{"origin":3840,"position":4},"title":"Vagrant\u3067VM\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u304c\u9045\u3044\u3068\u304d\u306e\u5bfe\u51e6\u6cd5","date":"2017\u5e749\u67081\u65e5","format":false,"excerpt":"Vagrant\u3067VM\u306e\u7ba1\u7406\u306bVirtualBox\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001Vagrantfile\u306e\u8a2d\u5b9a\u3092\u5909\u2026","rel":"","context":"Vagrant","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2017\/10\/icon_vagrant.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2633,"url":"https:\/\/akamist.com\/blog\/archives\/2633","url_meta":{"origin":3840,"position":5},"title":"[vagrant]\u30d7\u30ed\u30d3\u30b8\u30e7\u30cb\u30f3\u30b0\u3092vagrant\u30e6\u30fc\u30b6\u3067\u884c\u3046\u65b9\u6cd5","date":"2018\u5e745\u67085\u65e5","format":false,"excerpt":"vagrant\u3067\u306f\u521d\u56devagrant up\u6642\u306b\u30d7\u30ed\u30d3\u30b8\u30e7\u30cb\u30f3\u30b0\u51e6\u7406\u3092\u8d70\u3089\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u3053\u306e\u969b\u2026","rel":"","context":"Vagrant","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/akamist.com\/blog\/wp-content\/uploads\/2017\/10\/icon_vagrant.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/3840"}],"collection":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/comments?post=3840"}],"version-history":[{"count":2,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/3840\/revisions"}],"predecessor-version":[{"id":3842,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/posts\/3840\/revisions\/3842"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/media\/729"}],"wp:attachment":[{"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/media?parent=3840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/categories?post=3840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/akamist.com\/blog\/wp-json\/wp\/v2\/tags?post=3840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}