{"id":1652,"date":"2019-11-14T10:06:27","date_gmt":"2019-11-14T01:06:27","guid":{"rendered":"http:\/\/taki-lab.site\/bocci\/?p=1652"},"modified":"2019-11-14T10:06:29","modified_gmt":"2019-11-14T01:06:29","slug":"%e3%80%90linux%e3%80%91%e3%80%90laravel%e3%80%91laravel%e3%81%8b%e3%82%89%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%81%ab%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%81%99%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"https:\/\/taki-lab.site\/bocci\/?p=1652","title":{"rendered":"\u3010Linux\u3011\u3010Laravel\u3011Laravel\u304b\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3002"},"content":{"rendered":"\n<p>Laravel\u304b\u3089mysql\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3068\u3053\u308d\u307e\u3067\u3084\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">mysql\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt-get install mysql-server<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">mysql\u306e\u521d\u671f\u8a2d\u5b9a<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo mysql_secure_installation<\/pre>\n\n\n\n<p>\u57fa\u672c\u7684\u306by\u3092\u9078\u629e\u3059\u308c\u3070\u826f\u3044\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">root\u3067\u30ed\u30b0\u30a4\u30f3<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo mysql -u root -p<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4f5c\u6210<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql> create database &lt;\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d>;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30e6\u30fc\u30b6\u30fc\u306e\u8ffd\u52a0<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql> create user &lt;\u30e6\u30fc\u30b6\u30fc\u540d> identified by '&lt;\u30d1\u30b9\u30ef\u30fc\u30c9>';<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30e6\u30fc\u30b6\u30fc\u306b\u6a29\u9650\u3092\u4ed8\u4e0e<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql> grant all on <em>.<\/em> to &lt;\u30e6\u30fc\u30b6\u30fc\u540d>;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Laravel\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3092\u8a18\u5165<\/h2>\n\n\n\n<p>database.php\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">        'mysql' => [\n            'driver' => 'mysql',\n            'host' => env('DB_HOST', '127.0.0.1'),\n            'port' => env('DB_PORT', '3306'),\n            'database' => env('DB_DATABASE', '&lt;\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d>'),\n            'username' => env('DB_USERNAME', '&lt;\u30e6\u30fc\u30b6\u30fc\u540d>'),\n            'password' => env('DB_PASSWORD', '&lt;\u30d1\u30b9\u30ef\u30fc\u30c9>'),\n            'unix_socket' => env('DB_SOCKET', ''),\n            'charset' => 'utf8mb4',\n            'collation' => 'utf8mb4_unicode_ci',\n            'prefix' => '',\n            'strict' => true,\n            'engine' => null,\n        ],<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">migrate\u306e\u5b9f\u884c<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">$ php artisan migrate<\/pre>\n\n\n\n<p><strong>\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3002<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">could not find driver<\/pre>\n\n\n\n<p>PHP\u306b\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308bPDO\u304c\u306a\u3044\u3001\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u3001mysql\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8ffd\u52a0\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo apt-get install php7.2-mysql<\/pre>\n\n\n\n<p>\u3053\u308c\u3067migrate\u304c\u6210\u529f\u3059\u308c\u3070OK\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u9069\u5f53\u306a\u30c6\u30fc\u30d6\u30eb\u3092\u8ffd\u52a0\u3059\u308b<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">$ php artisan make:migration create_test_table<\/pre>\n\n\n\n<p>CreateTestTable\u30af\u30e9\u30b9\u304c\u51fa\u6765\u4e0a\u304c\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">    public function up()\n    {\n        Schema::create('test', function (Blueprint $table) {\n            $table->increments('id');\n            $table->text('text');\n            $table->timestamps();\n        });\n    }<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$ php artisan migrate<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Laravel\u304b\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">$ php artisan tinker<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">>>> DB::table('test')->get();\nDB::table('test')->insert(['test' => 'insert'])\nDB::table('test')->get();<\/pre>\n\n\n\n<p>\u30c7\u30fc\u30bf\u304c\u8868\u793a\u3055\u308c\u308c\u308c\u3070OK\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel\u304b\u3089mysql\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3068\u3053\u308d\u307e\u3067\u3084\u308a\u307e\u3057\u305f\u3002 mysql\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb $ sudo apt-get install mysql-server mysql\u306e\u521d\u671f\u8a2d\u5b9a $ sudo mysql_sec &hellip; <a href=\"https:\/\/taki-lab.site\/bocci\/?p=1652\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u3010Linux\u3011\u3010Laravel\u3011Laravel\u304b\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3002<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"\u3010Linux\u3011\u3010Laravel\u3011Laravel\u304b\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3002\n#TechCommit\n","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8,6,3],"tags":[138,79,139],"class_list":["post-1652","post","type-post","status-publish","format-standard","hentry","category-linux","category-web","category-3","tag-laravel","tag-linux","tag-mysql"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8SDbY-qE","jetpack-related-posts":[{"id":2516,"url":"https:\/\/taki-lab.site\/bocci\/?p=2516","url_meta":{"origin":1652,"position":0},"title":"\u3010Laravel\u3011\u307e\u3063\u3055\u3089\u306a\u72b6\u614b\u306eLinux\u304b\u3089\u74b0\u5883\u69cb\u7bc9","author":"taki","date":"2020\u5e743\u670815\u65e5","format":false,"excerpt":"\u3053\u306e\u8a18\u4e8b\u3001\u5b9a\u671f\u7684\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u3044\u3053\u3046\u3002 MySQL\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7 https:\/\/taki-la\u2026","rel":"","context":"Laravel","block_context":{"text":"Laravel","link":"https:\/\/taki-lab.site\/bocci\/?cat=167"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2513,"url":"https:\/\/taki-lab.site\/bocci\/?p=2513","url_meta":{"origin":1652,"position":1},"title":"\u3010Linux\u3011mysql\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u305f\u3089\u8e93\u3044\u305f\u306e\u3067","author":"taki","date":"2020\u5e743\u670815\u65e5","format":false,"excerpt":"\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u30e1\u30e2\u3057\u3066\u304a\u304f\u3002 MySQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb $ sudo apt-get install\u2026","rel":"","context":"Linux","block_context":{"text":"Linux","link":"https:\/\/taki-lab.site\/bocci\/?cat=8"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4273,"url":"https:\/\/taki-lab.site\/bocci\/?p=4273","url_meta":{"origin":1652,"position":2},"title":"\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011\u3010\u5165\u529b\u5c65\u6b74\u6a5f\u80fd\u3011\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u69cb\u7bc9","author":"taki","date":"2020\u5e7410\u67087\u65e5","format":false,"excerpt":"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u30b5\u30af\u30c3\u3068\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002 $ php artisan make:migration \u2026","rel":"","context":"Laravel","block_context":{"text":"Laravel","link":"https:\/\/taki-lab.site\/bocci\/?cat=167"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/10\/d544a19b4ab5409990f08842f77d57f0.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/10\/d544a19b4ab5409990f08842f77d57f0.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/10\/d544a19b4ab5409990f08842f77d57f0.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/10\/d544a19b4ab5409990f08842f77d57f0.png?resize=700%2C400 2x"},"classes":[]},{"id":8195,"url":"https:\/\/taki-lab.site\/bocci\/?p=8195","url_meta":{"origin":1652,"position":3},"title":"\u3010Linux\u3011MySQL\u306eroot\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5fd8\u308c\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u306e\u518d\u8a2d\u5b9a\u65b9\u6cd5","author":"taki","date":"2022\u5e744\u670823\u65e5","format":false,"excerpt":"\u3053\u3061\u3089\u306e\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\u3002 https:\/\/blog.katsubemakito.net\/my\u2026","rel":"","context":"Linux","block_context":{"text":"Linux","link":"https:\/\/taki-lab.site\/bocci\/?cat=8"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3254,"url":"https:\/\/taki-lab.site\/bocci\/?p=3254","url_meta":{"origin":1652,"position":4},"title":"\u3010LARAVEL\u3011\u3010\u30c0\u30a4\u30a8\u30c3\u30c8\u652f\u63f4\u3011VPS\u306b\u30c7\u30d7\u30ed\u30a4\u3059\u308b","author":"taki","date":"2020\u5e746\u670812\u65e5","format":false,"excerpt":"\u524d\u56de\u307e\u3067\u306e\u72b6\u6cc1\u306f\u3053\u3061\u3089\u3002 https:\/\/taki-lab.site\/bocci\/?p=3206 \u6700\u2026","rel":"","context":"Laravel","block_context":{"text":"Laravel","link":"https:\/\/taki-lab.site\/bocci\/?cat=167"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/06\/8e7f0e43cd25eb4b7f7ce883c5354768.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/06\/8e7f0e43cd25eb4b7f7ce883c5354768.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/06\/8e7f0e43cd25eb4b7f7ce883c5354768.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/06\/8e7f0e43cd25eb4b7f7ce883c5354768.jpg?resize=700%2C400 2x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/06\/8e7f0e43cd25eb4b7f7ce883c5354768.jpg?resize=1050%2C600 3x, https:\/\/i0.wp.com\/taki-lab.site\/bocci\/wp-content\/uploads\/2020\/06\/8e7f0e43cd25eb4b7f7ce883c5354768.jpg?resize=1400%2C800 4x"},"classes":[]},{"id":833,"url":"https:\/\/taki-lab.site\/bocci\/?p=833","url_meta":{"origin":1652,"position":5},"title":"VPS\u306bMySQL\u3092\u5165\u308c\u308b","author":"taki","date":"2019\u5e742\u67082\u65e5","format":false,"excerpt":"VPS\u306bMySQL\u3092\u5165\u308c\u307e\u3059\u3002 $ sudo apt-get install mysql-serve\u2026","rel":"","context":"Linux","block_context":{"text":"Linux","link":"https:\/\/taki-lab.site\/bocci\/?cat=8"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/1652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1652"}],"version-history":[{"count":3,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/1652\/revisions"}],"predecessor-version":[{"id":1655,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=\/wp\/v2\/posts\/1652\/revisions\/1655"}],"wp:attachment":[{"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taki-lab.site\/bocci\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}