{"id":478,"date":"2017-07-12T13:46:52","date_gmt":"2017-07-12T04:46:52","guid":{"rendered":"https:\/\/pc-taskal.net\/howto\/?p=478"},"modified":"2020-05-31T11:44:06","modified_gmt":"2020-05-31T02:44:06","slug":"wordpress-development-local","status":"publish","type":"post","link":"https:\/\/pc-taskal.net\/howto\/blog\/wordpress-development-local","title":{"rendered":"wordpress\u306e\u958b\u767a\u74b0\u5883\u3068\u306e\u3084\u308a\u3068\u308a"},"content":{"rendered":"<p>\u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u306e\u30c7\u30b6\u30a4\u30f3\u3084\u69cb\u6210\u306a\u3069\u3092\u30c6\u30b9\u30c8\u3059\u308b\u6642\u306b\u3001\u516c\u958b\u3057\u305f\u72b6\u614b\u3067\u3084\u308b\u3088\u308a\u3001\u30ed\u30fc\u30ab\u30eb\u306e\u958b\u767a\u74b0\u5883\u306b\u30af\u30ed\u30fc\u30f3\u3092\u4f5c\u6210\u3057\u3066\u30c6\u30b9\u30c8\u3057\u305f\u3044\u3082\u306e\u3067\u3059\u306d\u3002<\/p>\n<p>\u4e00\u5fdc\u81ea\u5206\u7528\u30e1\u30e2\u7684\u306a\u8981\u7d20\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u30fb\u30fb\u30fb<\/p>\n<p>\u4eee\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u3092\u300cwpblog\u300d<br \/>\n\u672c\u756a\u306e\u30b5\u30fc\u30d0\u30fcURL\u3092\u300chttp:\/\/example.com\/\u300d<br \/>\n\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306e\u30b5\u30fc\u30d0\u30fcURL\u3092\u300chttp:\/\/localhost\/\u300d<br \/>\nLunux\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u300cmyname\u300d<br \/>\nssh\u306e\u30dd\u30fc\u30c8\u3092\u300c9876\u300d<br \/>\n\u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308b\u516c\u958b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u300c\/var\/www\/html\u300d<\/p>\n<p>\u305d\u308c\u305e\u308c\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u64cd\u4f5c\u3068\u3057\u3066\u66f8\u3044\u3066\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-961\" src=\"https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-t.jpg\" alt=\"\u7ba1\u7406\u753b\u9762\u30a8\u30af\u30b9\u30dd\u30aa\u30fc\u30c8\" width=\"1280\" height=\"960\" srcset=\"https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-t.jpg 1280w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-t-320x240.jpg 320w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-t-1024x768.jpg 1024w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-t-768x576.jpg 768w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-t-530x398.jpg 530w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-t-565x424.jpg 565w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-t-710x533.jpg 710w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-t-725x544.jpg 725w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/p>\n<h2>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/h2>\n<p>\u672c\u756a\u74b0\u5883\u306emysqldump\u30b3\u30de\u30f3\u30c9\u306b\u3066\u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u300cwpblog\u300d\u3092wpblog.sql\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\">$ mysqldump -u root -p wpblog &gt;wpblog.sql<\/pre>\n<p>mysql\u306eroot\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u308c\u308b\u3068wpblog.sql\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u5b8c\u4e86\u3002<br \/>\n\u3053\u308c\u3067\u672c\u756a\u74b0\u5883\u3067\u306e\u64cd\u4f5c\u7d42\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u958b\u767a\u74b0\u5883\u306b\u30b3\u30d4\u30fc<\/h2>\n<p>\u30ed\u30fc\u30ab\u30eb\u304b\u3089sftp\u3067\u672c\u756a\u74b0\u5883\u306b\u63a5\u7d9a\u3057\u3066\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306bwpblog.sql\u3092\u30b3\u30d4\u30fc<\/p>\n<pre class=\"lang:default decode:true\" title=\"sftp\u3067\u672c\u756a\u304b\u3089\u30ed\u30fc\u30ab\u30eb\u306b\u30b3\u30d4\u30fc\">$ sftp -oPort=9876 myname@example.com\r\nmyname@example.com's password: \r\nConnected to example.com.\r\n\r\nsftp&gt; get wpblog.sql\r\n\r\nsftp&gt; exit<\/pre>\n<p class=\"al-c\"><iframe loading=\"lazy\" width=\"300\" height=\"250\" style=\"border: none;\" src=\"https:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?o=9&amp;p=12&amp;l=ur1&amp;category=amazonrotate&amp;f=ifr&amp;linkID=73c21e9e01040670916aa4bc8dbc0851&amp;t=pctaskal-22&amp;tracking_id=pctaskal-22\"><\/iframe><\/p>\n<h2>\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u64cd\u4f5c<\/h2>\n<h3>\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u30a4\u30f3\u30dd\u30fc\u30c8<\/h3>\n<p>mysql\u30b3\u30de\u30f3\u30c9\u3067\uff08dump\u3067\u306f\u306a\u3044\uff09\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4e0a\u66f8\u304d<\/p>\n<pre class=\"lang:default decode:true \" title=\"\u30ed\u30fc\u30ab\u30eb\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4e0a\u66f8\u304d\">$ mysql -u root -p wpblog &lt; wpblog.sql<\/pre>\n<p>&nbsp;<\/p>\n<p>mysql\u306eroot\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u308c\u308b\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4e0a\u66f8\u304d\u5b8c\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306eURL\u3092\u66f8\u304d\u63db\u3048<\/h3>\n<p>mysql\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u30662\u7b87\u6240\u306eURL\u3092\u66f8\u304d\u63db\u3048\u3002<\/p>\n<p>\u300c\u8a2d\u5b9a\u300d\u3000\u300c\u4e00\u822c\u8a2d\u5b9a\u300d\u306e\u3053\u306e\u90e8\u5206\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-479 size-full\" src=\"https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql.png\" alt=\"URL\u5165\u529b\u6b04\" width=\"1200\" height=\"328\" srcset=\"https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql.png 1840w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-320x87.png 320w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-1024x280.png 1024w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-768x210.png 768w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-1536x420.png 1536w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-530x145.png 530w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-565x154.png 565w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-710x194.png 710w, https:\/\/pc-taskal.net\/howto\/wp-content\/uploads\/2017\/07\/wp-mysql-725x198.png 725w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>\u3053\u3053\u304c\u9055\u3046\u3068\u672c\u756a\u74b0\u5883\u3092\u8aad\u307f\u306b\u884c\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3002<\/p>\n<h4>\u307e\u305a\u30ed\u30b0\u30a4\u30f3\u3002<\/h4>\n<pre class=\"lang:default decode:true \" title=\"mysql\u306b\u30ed\u30b0\u30a4\u30f3\">$ mysql -u root -p\r\nEnter password: \r\nWelcome to the MariaDB monitor. Commands end with ; or \\g.\r\nYour MariaDB connection id is 403\r\nServer version: 10.1.23-MariaDB-9+deb9u1 Debian 9.0\r\n\r\nCopyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nMariaDB [(none)]&gt;<\/pre>\n<p>mysql(mariaDB)\u306eroot\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u308c\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>\u5ff5\u306e\u70ba\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9wpblog\u304c\u3042\u308b\u304b\u3092\u78ba\u8a8d<\/h4>\n<pre class=\"lang:default decode:true \" title=\"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u78ba\u8a8d\">MariaDB [(none)]&gt; show databases;\r\n+--------------------+\r\n| Database |\r\n+--------------------+\r\n| information_schema |\r\n| mysql |\r\n| performance_schema |\r\n| wpblog |\r\n+--------------------+\r\n4 rows in set (0.00 sec)<\/pre>\n<p>&nbsp;<\/p>\n<h4>\u4f7f\u7528\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u6307\u5b9a<\/h4>\n<pre class=\"lang:default decode:true \" title=\"\u4f7f\u7528\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u6307\u5b9a\">MariaDB [(none)]&gt; use wpblog;\r\nReading table information for completion of table and column names\r\nYou can turn off this feature to get a quicker startup with -A\r\n\r\nDatabase changed\r\nMariaDB [wpblog]&gt;<\/pre>\n<p>&nbsp;<\/p>\n<h4>\u73fe\u5728\u306eURL\u3092\u78ba\u8a8d<\/h4>\n<pre class=\"lang:default decode:true \" title=\"\u73fe\u5728\u306e\u5024\u3092\u78ba\u8a8d\">MariaDB [wpblog]&gt; SELECT * FROM wp_options WHERE option_name IN ('home','siteurl');\r\n+-----------+-------------+--------------------+----------+\r\n| option_id | option_name | option_value | autoload |\r\n+-----------+-------------+--------------------+----------+\r\n| 2 | home | http:\/\/example.com | yes |\r\n| 1 | siteurl | http:\/\/example.com | yes |\r\n+-----------+-------------+--------------------+----------+\r\n2 rows in set (0.01 sec)<\/pre>\n<p>&nbsp;<\/p>\n<h4>URL\u306e\u66f8\u304d\u63db\u3048<\/h4>\n<pre class=\"lang:default decode:true \" title=\"URL\u3092\u66f8\u304d\u63db\u3048\">MariaDB [wpblog]&gt; UPDATE wp_options SET option_value = 'http:\/\/localhost\/' where option_name IN ('home','siteurl');\r\nQuery OK, 0 rows affected (0.01 sec)\r\nRows matched: 2 Changed: 0 Warnings: 0<\/pre>\n<p>&nbsp;<\/p>\n<h4>\u4e00\u5fdc\u78ba\u8a8d\u3057\u3066\u7d42\u4e86<\/h4>\n<pre class=\"lang:default decode:true \" title=\"\u78ba\u8a8d\u7d42\u4e86\">MariaDB [wpblog]&gt; SELECT * FROM wp_options WHERE option_name IN ('home','siteurl');\r\n+-----------+-------------+------------------+----------+\r\n| option_id | option_name | option_value | autoload |\r\n+-----------+-------------+------------------+----------+\r\n| 2 | home | http:\/\/localhost | yes |\r\n| 1 | siteurl | http:\/\/localhost | yes |\r\n+-----------+-------------+------------------+----------+\r\n2 rows in set (0.01 sec)\r\n\r\n\r\n\r\nMariaDB [wpblog]&gt;exit\r\nBye<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2>\u672c\u756a\u30b5\u30fc\u30d0\u304b\u3089wprdpress\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30b3\u30d4\u30fc<\/h2>\n<p>rsync\u3092\u4f7f\u3063\u3066\u30b5\u30af\u30c3\u3068<\/p>\n<pre class=\"lang:default decode:true \" title=\"\u672c\u756a\u304b\u3089\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30b3\u30d4\u30fc\">$ sudo rsync -avz -e \"ssh -p 9876\" myname@example.com:\/var\/www\/html\/ \/var\/www\/html\/<\/pre>\n<p>&nbsp;<\/p>\n<p>\u307e\u305asudo\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u308c\u308b\u3068\u3001\u6b21\u306bssh\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u8981\u6c42\u3055\u308c\u308b\u3002<\/p>\n<p>\u5b8c\u4e86\u3002<\/p>\n<p>\u5e83\u544a\u306a\u3069\u30a6\u30a3\u30b8\u30c3\u30c8\u306b\u3088\u3063\u3066\u306f\u518d\u767b\u9332\u306e\u5fc5\u8981\u304c\u3042\u308b\u304b\u3082\u77e5\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u672c\u756a\u74b0\u5883\u3078\u306e\u9069\u7528<\/h2>\n<p>\u958b\u767a\u74b0\u5883\u3067\u306e\u4f5c\u696d\u304c\u7d42\u308f\u3063\u305f\u5f8c\u306b\u672c\u756a\u74b0\u5883\u3078\u306e\u9069\u7528\u306f\u3001\u305d\u306e\u307e\u307e\u624b\u52d5\u3067\u672c\u756a\u74b0\u5883\u3067\u5909\u66f4\u3057\u305f\u307b\u3046\u304c\u697d\u304b\u3082\u3002<\/p>\n<p>\u5185\u5bb9\u306b\u3088\u3063\u3066\u306f\u30ed\u30fc\u30ab\u30eb\u672c\u756a\u9006\u306e\u624b\u9806\u3067\u3002<\/p>\n<p>\u74b0\u5883\u306b\u3088\u3063\u3066\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u64cd\u4f5c\u306fphpmyadmin\u306a\u3069\u3067\u64cd\u4f5c\u3057\u3066\u3082\u3044\u3044\u3057\u3001sftp\u3084\u3089rsync\u304c\u4f7f\u3048\u306a\u3051\u308c\u3070ftp\u30bd\u30d5\u30c8\u304b\u306a\u3002<\/p>\n<p>\u3067\u304d\u308b\u306a\u3089\u30b3\u30de\u30f3\u30c9\u3067\u3084\u3063\u305f\u65b9\u304c\u7c21\u5358\u304b\u306a\u3002<\/p>\n<p class=\"al-c\"><script async=\"\" src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<!-- pctaskal-req --><br \/>\n<ins class=\"adsbygoogle\" style=\"display: inline-block; width: 336px; height: 280px;\" data-ad-client=\"ca-pub-9013483608213524\" data-ad-slot=\"5284676934\"><\/ins><br \/>\n<script><br \/>\n(adsbygoogle = window.adsbygoogle || []).push({});<br \/>\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u306e\u30c7\u30b6\u30a4\u30f3\u3084\u69cb\u6210\u306a\u3069\u3092\u30c6\u30b9\u30c8\u3059\u308b\u6642\u306b\u3001\u516c\u958b\u3057\u305f\u72b6\u614b\u3067\u3084\u308b\u3088\u308a\u3001\u30ed\u30fc\u30ab\u30eb\u306e\u958b\u767a\u74b0\u5883\u306b\u30af\u30ed\u30fc\u30f3\u3092\u4f5c\u6210\u3057\u3066\u30c6\u30b9\u30c8\u3057\u305f\u3044\u3082\u306e\u3067\u3059\u306d\u3002 \u4e00\u5fdc\u81ea\u5206\u7528\u30e1\u30e2\u7684\u306a\u8981\u7d20\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u30fb\u30fb\u30fb \u4eee\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u3092\u300cwpblog\u300d  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":961,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42,37],"tags":[52,84,83,68,82],"class_list":["post-478","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-server","category-blog","tag-linux","tag-mariadb","tag-mysql","tag-server","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/posts\/478","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/comments?post=478"}],"version-history":[{"count":0,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/posts\/478\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/media\/961"}],"wp:attachment":[{"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/media?parent=478"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/categories?post=478"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pc-taskal.net\/howto\/wp-json\/wp\/v2\/tags?post=478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}