{"id":2754,"date":"2018-10-02T00:00:15","date_gmt":"2018-10-01T15:00:15","guid":{"rendered":"https:\/\/1bed.allright.life\/?p=2754"},"modified":"2020-04-18T19:27:57","modified_gmt":"2020-04-18T10:27:57","slug":"post-2754","status":"publish","type":"post","link":"https:\/\/1bed.allright.life\/?p=2754","title":{"rendered":"WSL \u306e MySQL \u306b A5:SQL Mk-2 \u304b\u3089\u63a5\u7d9a\u3059\u308b"},"content":{"rendered":"<p>\u4f55\u306b\u4f7f\u3046\u304b\u306f\u805e\u304b\u306a\u3044\u3067\u6b32\u3057\u3044\u500b\u4eba\u30e1\u30e2<\/p>\n<h2>Ubuntu \u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n<ol>\n<li>\n<p>WSL \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\nPowerShell \u3092\u8d77\u52d5\u3057\u3066\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b  <\/p>\n<pre><code class=\"language-powershell\">\nEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux\n```<\/code><\/pre>\n<\/li>\n<li>\n<p>WSL \u306b Ubuntu \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\nMicrosoft Store \u304b\u3089\u300cLinux\u300d\u3067\u691c\u7d22\u3057\u3066\u3001Ubuntu \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n\u203b\u4eca\u56de\u306f Ubuntu 18.04 LTS \u3092\u5165\u308c\u305f<br \/>\n<a href=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2018\/10\/2018-10-02_1.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2018\/10\/2018-10-02_1-300x220.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>Ubuntu \u306e\u8d77\u52d5<br \/>\nWindows \u30e1\u30cb\u30e5\u30fc\u304b\u3089 Ubuntu \u3092\u5b9f\u884c\u3059\u308b<br \/>\n<a href=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2018\/10\/2018-10-02_2.png\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2018\/10\/2018-10-02_2-300x94.png\" alt=\"\" \/><\/a><br \/>\n\u203b\u3082\u3057\u3053\u3053\u3067\u300c0x8007019e\u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3088\u3046\u306a\u3089\u3001WSL \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3046  <\/p>\n<\/li>\n<li>\n<p>Ubuntu \u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<br \/>\nUbuntu \u8d77\u52d5\u4e2d\u306b root \u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u767b\u9332\u3092\u6c42\u3081\u3089\u308c\u308b\u306e\u3067\u767b\u9332\u3059\u308b<\/p>\n<\/li>\n<\/ol>\n<h2>MySQL \u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n<ol>\n<li>\n<p>MySQL \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<pre><code class=\"language-bash\">$ sudo apt install mysql-server mysql-client<\/code><\/pre>\n<\/li>\n<li>\n<p>MySQL \u306e\u8d77\u52d5<\/p>\n<pre><code class=\"language-bash\">$ sudo service mysql start<\/code><\/pre>\n<\/li>\n<li>\n<p>MySQL \u3078\u63a5\u7d9a<\/p>\n<pre><code class=\"language-bash\">$ sudo mysql -u root<\/code><\/pre>\n<\/li>\n<li>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4f5c\u6210<br \/>\n\u3053\u3053\u3067\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d misono \u3092\u30014 \u30d0\u30a4\u30c8\u5bfe\u5fdc UTF-8 \u3067\u4f5c\u6210  <\/p>\n<pre><code class=\"language-sql\">mysql> CREATE DATABASE misono DEFAULT CHARACTER SET utf8mb4;Query<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5916\u90e8\u63a5\u7d9a\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210<br \/>\n\u5168\u3066\u306e\u6a29\u9650\u3092\u6301\u3061\u3001\u3069\u3053\u304b\u3089\u3067\u3082\u30a2\u30af\u30bb\u30b9\u53ef\u306e\u30e6\u30fc\u30b6\u30fc\u300choge\u300d\u3092\u4f5c\u6210\u3059\u308b  <\/p>\n<pre><code class=\"language-sql\">mysql> GRANT ALL PRIVILEGES ON *.* TO hoge@\"%\" IDENTIFIED BY 'hoge' WITH GRANT OPTION;<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2>A5:SQL Mk-2 \u304b\u3089 WSL MySQL \u3078\u63a5\u7d9a<\/h2>\n<ol>\n<li>\n<p>A5:SQL \u3092\u8d77\u52d5\u3057\u3001\u300c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8ffd\u52a0\u3068\u524a\u9664\u300d\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u958b\u304f<\/p>\n<p><a href=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2018\/10\/2018-10-02_3.png\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2018\/10\/2018-10-02_3-300x296.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>\u300c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8ffd\u52a0\u3068\u524a\u9664\u300d\u30a6\u30a3\u30f3\u30c9\u30a6\u3067 [\u8ffd\u52a0] \u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3057\u3001\u63a5\u7d9a\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u30bf\u30a4\u30d7\u3067\u300cMySQL\/MariaDB (\u76f4\u63a5\u63a5\u7d9a)\u300d\u3092\u9078\u629e\u3059\u308b<\/p>\n<p><a href=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2018\/10\/2018-10-02_4.png\" data-rel=\"lightbox-image-3\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2018\/10\/2018-10-02_4-220x300.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>\u63a5\u7d9a\u3059\u308b<br \/>\n\u4e0b\u8a18\u60c5\u5831\u3092\u8a2d\u5b9a\u3057\u3066\u3001[\u30c6\u30b9\u30c8\u63a5\u7d9a] \u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3059\u308b<\/p>\n<ul>\n<li>\u30db\u30b9\u30c8\u540d\uff1a localhost  <\/li>\n<li>\u30e6\u30fc\u30b6\u30fcID\uff1a hoge  <\/li>\n<li>\u30d1\u30b9\u30ef\u30fc\u30c9\uff1a hoge  <\/li>\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\uff1a misono  <\/li>\n<\/ul>\n<p><a href=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2018\/10\/2018-10-02_5.png\" data-rel=\"lightbox-image-4\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"https:\/\/1bed.allright.life\/wp-content\/uploads\/2018\/10\/2018-10-02_5-300x216.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u4f55\u306b\u4f7f\u3046\u304b\u306f\u805e\u304b\u306a\u3044\u3067\u6b32\u3057\u3044\u500b\u4eba\u30e1\u30e2 Ubuntu \u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7 WSL \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb PowerShell \u3092\u8d77\u52d5\u3057\u3066\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b Enable-WindowsOptionalFeature -Onlin [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49,17],"tags":[121,120,119],"class_list":["post-2754","post","type-post","status-publish","format-standard","hentry","category-database","category-linux","tag-mysql","tag-ubuntu","tag-wsl"],"_links":{"self":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2754"}],"version-history":[{"count":21,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2754\/revisions"}],"predecessor-version":[{"id":3102,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2754\/revisions\/3102"}],"wp:attachment":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}