{"id":2212,"date":"2012-01-23T12:21:13","date_gmt":"2012-01-23T03:21:13","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=2212"},"modified":"2020-03-20T17:30:03","modified_gmt":"2020-03-20T08:30:03","slug":"mysql%e9%96%a2%e6%95%b0-mysql_list_dbs-%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e4%b8%80%e8%a6%a7%e8%a1%a8%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=2212","title":{"rendered":"MySQL\u95a2\u6570 mysql_list_dbs \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e00\u89a7\u8868\u793a"},"content":{"rendered":"<p>MySQL\u95a2\u6570\u3000mysql_list_dbs\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\u3067\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">resource\u00a0mysql_list_dbs\u00a0(&#x5B;resource\u00a0\u63a5\u7d9aID\u00a0])<\/pre>\n<p style=\"margin-top: 3em;\">\u3053\u306emysql_list_dbs\u3092\u4f7f\u3044\u3001PHP\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e00\u89a7\u8868\u793a\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p style=\"margin-top: 1em;\"><strong>PHP\u00a0<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&lt;?\r\n$link =mysql_connect(&quot;localhost&quot;,&quot;root&quot;,&quot;&quot;);\r\n$db_list = mysql_list_dbs($link);\r\n\/*\u00a0mysql_db_name()\u95a2\u6570\u3092\u4f7f\u3044\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97*\/\r\n$i = 0;\r\n$db_rows = mysql_num_rows($db_list);\r\nwhile\u00a0($i &lt; $db_rows){\r\necho\u00a0mysql_db_name($db_list , $i).&quot;&lt;br\u00a0\/&gt;&quot;;\r\n$i++;\r\n}\r\n?&gt;\r\n<\/pre>\n<p style=\"margin-top: 1em;\"><strong>\u7d50\u679c<\/strong><\/p>\n<p style=\"margin-top: 1em;\">information_schema<br \/>\nmysql<br \/>\nphpmyadmin<br \/>\nwordpress<\/p>\n<p style=\"margin-top: 1em;\">\u7b49<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL\u95a2\u6570\u3000mysql_list_dbs\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\u3067\u3059\u3002 resource\u00a0mysql_list_dbs\u00a0(&#x5B;resource\u00a0\u63a5\u7d9aID\u00a0]) \u3053\u306emysql_list_dbs\u3092\u4f7f\u3044\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[180,173,85],"class_list":["post-2212","post","type-post","status-publish","format-standard","hentry","category-php","tag-mysql","tag-php","tag-85"],"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/2212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2212"}],"version-history":[{"count":9,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/2212\/revisions"}],"predecessor-version":[{"id":10148,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/2212\/revisions\/10148"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}