{"id":66064,"date":"2025-04-29T12:22:07","date_gmt":"2025-04-29T03:22:07","guid":{"rendered":"https:\/\/pokosho.com\/b\/?p=66064"},"modified":"2025-04-29T22:56:47","modified_gmt":"2025-04-29T13:56:47","slug":"wordpress%e3%81%aedb%e3%82%92tidb%e3%81%ab%e4%bb%a5%e9%99%8d%e3%81%97%e3%81%9f","status":"publish","type":"post","link":"https:\/\/pokosho.com\/b\/archives\/66064","title":{"rendered":"WordPress\u306eDB\u3092TiDB\u306b\u79fb\u884c\u3057\u307e\u3057\u305f"},"content":{"rendered":"<div>\n<div>\u7121\u6599\u67a0\u3067\u9811\u5f35\u3063\u3066\u3044\u308bWordPress \u30d6\u30ed\u30b0 pokosho\u3002\u8272\u3005\u554f\u984c\u304c\u3067\u3066\u304d\u305f\u3002<\/div>\n<\/div>\n<p><!--more--><\/p>\n<ul>\n<li>Google Cloud\u306et2.micro\u3067MySQL on GCE\u3060\u3068\u30ea\u30bd\u30fc\u30b9\u304c\u8db3\u308a\u306a\u304f\u3066\u3059\u3050\u6b7b\u306c(\u5b9f\u306fswap\u3092\u4f5c\u308a\u5fd8\u308c\u3066\u3044\u305f\u3060\u3051\u3060\u3063\u305f\u3051\u3069\u2026)<\/li>\n<li>\u74b0\u5883\u79fb\u884c\u304c\u3060\u308b\u3044\u306e\u3067\u5f8c\u56de\u3057\u306b\u306a\u308b\u3002\u7279\u306bDB\u3002\u3053\u308c\u3055\u3048\u3044\u306a\u3051\u308c\u3070ansible\u306a\u3069\u306b\u79fb\u884c\u3057\u3084\u3059\u3044(\u50d5\u306e\u77e5\u8b58\u304c\u306a\u3044\u3060\u3051\u304b\u3082\u3060\u3051\u3069)<\/li>\n<\/ul>\n<p>\u305d\u3093\u306a\u3067TiDB\u306eserverless\u306e\u7121\u6599\u67a0\u306b\u79fb\u884c\u3057\u3066\u307f\u305f\u3002<br \/>\nPostgreSQL\u4e92\u63db\u306e\u306f\u305f\u304f\u3055\u3093\u3042\u308b\u3051\u3069MySQL\u306e\u306f\u3053\u308c\u3057\u304b\u3057\u3089\u306a\u3044\u3002\u3042\u308a\u304c\u305f\u3059\u304e\u308b\u2026<\/p>\n<p>\u82e5\u5e72\u306e\u30cf\u30de\u308a\u30dd\u30a4\u30f3\u30c8\u304c\u3042\u3063\u305f\u3002<\/p>\n<h2>\u30dd\u30fc\u30c8\u306e\u6307\u5b9a\u3068SSL<\/h2>\n<blockquote><p>define(&#8216;FS_METHOD&#8217;, &#8216;direct&#8217;);<br \/>\ndefine( &#8216;DB_NAME&#8217;, &#8216;wordpress&#8217; );<br \/>\ndefine( &#8216;DB_USER&#8217;, &#8216;xxx.yuzan&#8217; );<br \/>\ndefine( &#8216;DB_PASSWORD&#8217;, &#8216;sugoi-password&#8217; );<br \/>\n\/\/ port\u306e\u6307\u5b9a\u306f :4000<br \/>\ndefine( &#8216;DB_HOST&#8217;, &#8216;gateway01.ap-northeast-1.prod.aws.tidbcloud.com:4000&#8217; );<br \/>\ndefine( &#8216;DB_CHARSET&#8217;, &#8216;utf8mb4&#8217; );<br \/>\ndefine( &#8216;DB_COLLATE&#8217;, &#8216;utf8mb4_general_ci&#8217; );<br \/>\n\/\/ SSL\u3067\u901a\u4fe1\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b<br \/>\ndefine(&#8216;MYSQL_CLIENT_FLAGS&#8217;, MYSQLI_CLIENT_SSL);<br \/>\ndefine(&#8216;MYSQL_SSL_CA&#8217;, &#8216;\/etc\/ssl\/certs\/ca-certificates.crt&#8217;);<\/p><\/blockquote>\n<h2>\u30dd\u30fc\u30c8\u306e\u6307\u5b9a\u3068SSL<\/h2>\n<p>SQL_CALC_FOUND_ROWS \u306e\u30a8\u30e9\u30fc\u304c\u3067\u308b\u3002\u4ee5\u4e0b\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/pingcap\/wordpress-tidb-plugin\">https:\/\/github.com\/pingcap\/wordpress-tidb-plugin<\/a><\/p>\n<p>WordPress\u306e\u30de\u30fc\u30b1\u30c3\u30c8\u306b\u306f\u3044\u306a\u3044\u306e\u3067\u3001zip\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3001wp-contents\/plugins \u306b\u5c55\u958b\u3057\u3066\u6709\u52b9\u5316\u3059\u308b\u3002<br \/>\n\u3053\u308c\u306f\u591a\u5206\u3001post\u306e\u4ef6\u6570\u3092\u53d6\u5f97\u3059\u308b\u306e\u306b\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3057\u3087\u3046\u3002\u3053\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u4ee3\u308f\u308a\u306b count \u3092\u4f7f\u3046\u306e\u304b\u306a\uff1f<br \/>\n\u305d\u306e\u7d50\u679c\u3001post id\u304c\u4e00\u6841\u5897\u3048\u305f\u307f\u305f\u3044\u3002<\/p>\n<h2>\u3069\u3046\u306a\u3063\u305f\uff1f<\/h2>\n<p>\u30aa\u30ec\u30b4\u30f3\u3001\u65e5\u672c\u9593\u306e\u30ec\u30a4\u30c6\u30f3\u30b7\u3092\u611f\u3058\u308b\u3002<br \/>\n\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306f\u307e\u3042\u4ed5\u65b9\u306a\u3044\u3093\u3060\u3051\u3069\u3001\u8868\u793a\u3082\u9045\u304f\u306a\u3063\u305f\u3002<br \/>\nCloudflare\u3055\u3093\u304c\u6c17\u3092\u5229\u304b\u3057\u3066\u306a\u3093\u304b\u3084\u3063\u3066\u304f\u308c\u3066\u308b\u3093\u3060\u308d\u3046\u3051\u3069\u3001\u30ac\u30c3\u30c4\u30ea\u30ad\u30e3\u30c3\u30b7\u30e5\u3057\u3066\u3044\u3044\u3093\u3067\u3059\u3088\uff01<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u5c0f\u3055\u3044WordPress\u306a\u306e\u306b\u591a\u304f\u306e\u7121\u6599\u30b5\u30fc\u30d3\u30b9\u306e\u304a\u4e16\u8a71\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30c9\u30e1\u30a4\u30f3\u3068CDN\u306bCloudfront<\/li>\n<li>\u30b5\u30fc\u30d0\u306bGCE(us-west1,\u30aa\u30ec\u30b4\u30f3)<\/li>\n<li>DB\u306bTiDB(\u65e5\u672c)<\/li>\n<li>\u76e3\u8996\u306bMackerel<\/li>\n<li>\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306bGCS<\/li>\n<\/ul>\n<p>\u3053\u308c\u307e\u3067\u306e\u3059\u3079\u3066\u306b\u611f\u8b1d\u2026\uff01<br \/>\n\u3044\u3084\u3001\u610f\u5730\u6c5a\u3044\u3001\u3068\u3044\u3046\u6c17\u3082\u3057\u307e\u3059\u304c\u3001\u3053\u3046\u3084\u3063\u3066\u3044\u308d\u3093\u306a\u30b5\u30fc\u30d3\u30b9\u306b\u89e6\u3063\u3066\u304a\u304f\u3068\u3044\u308d\u3093\u306a\u5b66\u3073\u304c\u3042\u3063\u3066\u3001\u696d\u52d9\u3067\u3061\u3083\u3093\u3068\u304a\u91d1\u3092\u6255\u3063\u3066\u4f7f\u3063\u305f\u308a\u4f7f\u308f\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u308f\u3051\u3067\u3059\u3088(\u8a00\u3044\u8a33)\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7121\u6599\u67a0\u3067\u9811\u5f35\u3063\u3066\u3044\u308bWordPress \u30d6\u30ed\u30b0 pokosho\u3002\u8272\u3005\u554f\u984c\u304c\u3067\u3066\u304d\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[7],"tags":[],"class_list":["post-66064","post","type-post","status-publish","format-standard","hentry","category-program"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pokosho.com\/b\/wp-json\/wp\/v2\/posts\/66064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pokosho.com\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pokosho.com\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pokosho.com\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pokosho.com\/b\/wp-json\/wp\/v2\/comments?post=66064"}],"version-history":[{"count":0,"href":"https:\/\/pokosho.com\/b\/wp-json\/wp\/v2\/posts\/66064\/revisions"}],"wp:attachment":[{"href":"https:\/\/pokosho.com\/b\/wp-json\/wp\/v2\/media?parent=66064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pokosho.com\/b\/wp-json\/wp\/v2\/categories?post=66064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pokosho.com\/b\/wp-json\/wp\/v2\/tags?post=66064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}