
Warning: Error while sending QUERY packet. PID=5176 in /home/uls/public_html/wordpress/wp-includes/class-wpdb.php on line 2357
{"id":102,"date":"2011-08-02T08:32:22","date_gmt":"2011-08-02T08:32:22","guid":{"rendered":"http:\/\/192.168.1.20\/wordpress\/freebsd\/2011\/08\/02\/word_pressmysql\/"},"modified":"2015-01-25T01:48:18","modified_gmt":"2015-01-25T01:48:18","slug":"word_pressmysql","status":"publish","type":"post","link":"http:\/\/uls.self.jp\/wordpress\/freebsd\/?p=102","title":{"rendered":"Word Press\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068MySQL"},"content":{"rendered":"<p>\u30d6\u30ed\u30b0\u306e\u4f5c\u6210\u306b\u306fMovabletype\u3092\u7528\u3044\u3066\u3044\u308b\u304c\u3001\u30d6\u30ed\u30b0\u4f5c\u6210\u30c4\u30fc\u30eb\u3068\u3057\u3066\u7c73\u56fd\u306a\u3069\u3067\u306f\u3001Word Press\u304c\u5727\u5012\u7684\u306b\u5927\u304d\u306a\u30b7\u30a7\u30a2\u3092\u5360\u3081\u3066\u3044\u308b\u3002<br \/>\n\u76f4\u3061\u306bWord Press\u306b\u79fb\u884c\u3057\u3088\u3046\u3068\u306f\u601d\u3063\u3066\u3044\u306a\u3044\u304c\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u69d8\u5b50\u3092\u898b\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u305f\u3002<br \/>\nWord Press\u306f\u3001php\u3067\u66f8\u304b\u308c\u3066\u304a\u308a\u3001MySQL\u4e0a\u306e\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u3092\u7528\u3044\u3066\u3001\u30c0\u30a4\u30ca\u30df\u30c3\u30af\u306b\u30da\u30fc\u30b8\u3092\u9001\u51fa\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u3059\u306a\u308f\u3061\u3001php\u3068MySQL\u304c\u5fc5\u9808\u306a\u306e\u3067\u3042\u308b\u3002\u304b\u3064\u3001\u65e5\u672c\u8a9e\u4f7f\u7528\u3067\u306f\u6587\u5b57\u30b3\u30fc\u30c9\u306futf-8\u3092\u4f7f\u3046\u3053\u3068\u3092\u524d\u63d0\u3067\u4f5c\u3089\u308c\u3066\u3044\u308b\u3002EUC\u3067\u52d5\u304b\u305d\u3046\u306a\u3069\u3068\u306f\u3001\u8003\u3048\u306a\u3044\u65b9\u304c\u826f\u3055\u305d\u3046\u3060\u3002<\/p>\n<h4>1. \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<blockquote><p>(1) Word Press\u306e\u65e5\u672c\u8a9e\u306e\u30da\u30fc\u30b8\u3088\u308a\u3001\u6700\u65b0\u7248\u306ewordpress-3.2.1-ja.zip\u3092\u30c0\u30a6\u30f3\u30ed\u30c9\u3057\u3066\u89e3\u51cd\u3057\u3001\u30d5\u30a9\u30fc\u30eb\u30c0\u30fc\u3054\u3068Web\u767a\u4fe1\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u306b\u5165\u308c\u308b\u3002<br \/>\n(2) \u30d5\u30a9\u30eb\u30c0\u30fc\u540d\u3092wordpress\u3068\u3059\u308b\u3068\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306bwordpress\u30d5\u30a9\u30eb\u30c0\u30fc\u5185\u306ewp-config-sample.php\u3092wp-config.php\u306b\u540d\u524d\u3092\u5909\u3048\u3001\u5185\u5bb9\u3092\u4fee\u6b63\u3059\u308b\u3002<\/p><\/blockquote>\n<pre># cd wordpress\n# cp wp-config-sample.php wp-config.php\n# vi wp-config.php\ndefine('DB_NAME', '<font color=\"#ff0000\">wpdb<\/font>');  \u2190 DB\u540d\u3092\u5165\u308c\u308b\u3002\ndefine('DB_USER', '<font color=\"#ff0000\">wpuser<\/font>'); \u2190 DB\u306e\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u5165\u308c\u308b\u3002\ndefine('DB_PASSWORD', '<font color=\"#ff0000\">******<\/font>'); \u2190 DB\u30a2\u30af\u30bb\u30b9\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u308c\u308b\u3002\ndefine('DB_HOST', 'localhost');\ndefine('DB_CHARSET', 'utf8');<\/pre>\n<h4>2. \u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u306e\u4f5c\u6210<\/h4>\n<blockquote><p>Movabletype\u3067\u306fEUC\u30b3\u30fc\u30c9\u3067\u904b\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u3001MySQL\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306bujis\uff08EUC)\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p><\/blockquote>\n<pre>mysql&gt; SHOW VARIABLES LIKE 'character_set_%';\n+----------------------------------+--------+\n| Variable_name            \u3000\u3000\u3000\u3000\u3000| Value   |\n+----------------------------------+--------+\n| character_set_client    \u3000\u3000\u3000\u3000  | ujis       |\n| character_set_connection          | ujis       |\n| character_set_database  \u3000\u3000\u3000 | ujis       |\n| character_set_filesystem            | binary  |\n| character_set_results    \u3000\u3000\u3000\u3000| ujis       |\n| character_set_server     \u3000\u3000\u3000\u3000| ujis      |\n| character_set_system     \u3000\u3000\u3000  | utf8     |\n+----------------------------------+--------+<\/pre>\n<blockquote><p>\u3057\u304b\u3057\u3001Word Press\u3067\u306f\u3001utf8\u3068\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u6587\u5b57\u30b3\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u3066\u3001\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p><\/blockquote>\n<pre># mysql -u root -p\nEnter password: \u30d1\u30b9\u30ef\u30fc\u30c9\nmysql&gt; create database wpdb <font color=\"#ff0000\">CHARACTER SET utf8<\/font>;;\nQuery OK, 1 row affected (0.00 sec)\nmysql&gt; grant all privileges on wpdb.* to wpuser@localhost identified by '\u30d1\u30b9\u30ef\u30fc\u30c9';\nQuery OK, 0 rows affected (0.13 sec)\nmysql&gt; flush privileges;\nmysql&gt; exit;\nBye<\/pre>\n<blockquote><p>\u3053\u308c\u3067\u3001\u5ff5\u306e\u305f\u3081\u306b\u6587\u5b57\u30b3\u30fc\u30c9\u3092\u8868\u793a\u3057\u3066\u307f\u308b\u3002<\/p><\/blockquote>\n<pre>$ mysql -u root -p\nEnter password:\nmysql&gt; use wpdb;\nDatabase changed\nmysql&gt; SHOW VARIABLES LIKE 'character_set_%';\n+----------------------------+--------+\n| Variable_name                   | Value  |\n+----------------------------+--------+\n| character_set_client          | ujis      |\n| character_set_connection | ujis      |\n| character_set_database    | utf8     |\u3000\u3000\u2190 \u3053\u3053\u304cutf8\u306b\u306a\u3063\u3066\u3044\u308c\u3070OK\n| character_set_filesystem   | binary  |\n| character_set_results        | ujis       |\n| character_set_server        | ujis       |\n| character_set_system       | utf8      |\n+----------------------------+--------+\n7 rows in set (0.00 sec)<\/pre>\n<h4>3. PHP\u306b\u5bfe\u3059\u308b\u51e6\u7f6e<\/h4>\n<blockquote><p>MySQL\u306e\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u3092utf8\u306b\u3057\u3066\u3001Word Press\u3092\u8d77\u52d5\u3059\u308b\u3068\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3059\u308b\u304b\u306b\u898b\u3048\u305f\u304c\u3001\u8a18\u4e8b\u3092\u6295\u7a3f\u3057\u3066\u3082\u8a18\u4e8b\u5185\u5bb9\u304c\u4fdd\u5b58\u3055\u308c\u306a\u3044\u4e8b\u8c61\u304c\u767a\u751f\u3057\u305f\u3002<br \/>\nPHP\u3082utf8\u3067\u51e6\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u305d\u3053\u3067\u3001wordpress\u30d5\u30a9\u30fc\u30eb\u30c0\u30fc\u5185\u306b.htaccess\u3092\u4f5c\u308a\u4e0b\u8a18\u306e\u5185\u5bb9\u3092\u5165\u308c\u305f\u3089\u3001\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002\u3084\u308c\u3084\u308c\u3002<\/p><\/blockquote>\n<pre># vi .htaccess\nDirectoryIndex index.html index.cgi index.php index.shtml\nphp_flag mbstring.encoding_translation off\nphp_value default_charset \"UTF-8\"<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u30d6\u30ed\u30b0\u306e\u4f5c\u6210\u306b\u306fMovabletype\u3092\u7528\u3044\u3066\u3044\u308b\u304c\u3001\u30d6\u30ed\u30b0\u4f5c\u6210\u30c4\u30fc\u30eb\u3068\u3057\u3066\u7c73\u56fd\u306a\u3069\u3067\u306f\u3001Word Press\u304c\u5727\u5012\u7684\u306b\u5927\u304d\u306a\u30b7\u30a7\u30a2\u3092\u5360\u3081\u3066\u3044\u308b\u3002 \u76f4\u3061\u306bWord Press\u306b\u79fb\u884c\u3057\u3088\u3046\u3068\u306f\u601d\u3063\u3066\u3044\u306a\u3044\u304c\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057 &hellip; <a href=\"http:\/\/uls.self.jp\/wordpress\/freebsd\/?p=102\">Continue reading <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":{"footnotes":""},"categories":[7,10],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-database","category-wordpress","wpautop"],"_links":{"self":[{"href":"http:\/\/uls.self.jp\/wordpress\/freebsd\/index.php?rest_route=\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/uls.self.jp\/wordpress\/freebsd\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/uls.self.jp\/wordpress\/freebsd\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/uls.self.jp\/wordpress\/freebsd\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/uls.self.jp\/wordpress\/freebsd\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=102"}],"version-history":[{"count":2,"href":"http:\/\/uls.self.jp\/wordpress\/freebsd\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":284,"href":"http:\/\/uls.self.jp\/wordpress\/freebsd\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions\/284"}],"wp:attachment":[{"href":"http:\/\/uls.self.jp\/wordpress\/freebsd\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/uls.self.jp\/wordpress\/freebsd\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/uls.self.jp\/wordpress\/freebsd\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}