{"id":5122,"date":"2024-11-14T08:37:27","date_gmt":"2024-11-14T00:37:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5122\/"},"modified":"2024-11-14T08:37:27","modified_gmt":"2024-11-14T00:37:27","slug":"mysql%e6%89%a9%e5%b1%95%e6%80%8e%e4%b9%88%e5%bc%80%e5%90%af","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5122\/","title":{"rendered":"mysql\u6269\u5c55\u600e\u4e48\u5f00\u542f"},"content":{"rendered":"<blockquote><p>\n  \u5f00\u542f mysql \u6269\u5c55\u5171\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a \u4f7f\u7528 pecl \u5b89\u88c5\uff1a\u5b89\u88c5 pecl \u5b89\u88c5\u7a0b\u5e8f\uff0c\u8fd0\u884c pecl install pdo_mysql\uff0c\u7f16\u8bd1 php \u6269\u5c55\u3002 \u4f7f\u7528\u6269\u5c55\u7ba1\u7406\u5668\uff1a\u5728 php.ini \u4e2d\u627e\u5230\u5e76\u53d6\u6d88\u6ce8\u91ca extension=pdo_mysql.so \u884c\uff0c\u7136\u540e\u91cd\u542f web \u670d\u52a1\u5668\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/22\/2024052214182656755.jpg\" class=\"aligncenter\" title=\"mysql\u6269\u5c55\u600e\u4e48\u5f00\u542f\u63d2\u56fe\" alt=\"mysql\u6269\u5c55\u600e\u4e48\u5f00\u542f\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u6269\u5c55\u5f00\u542f\u65b9\u6cd5<\/strong><\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong>\u5982\u4f55\u5f00\u542f MySQL \u6269\u5c55\uff1f<\/p>\n<p><strong>\u56de\u7b54\uff1a<\/strong>\u6709\u4e24\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5f00\u542f MySQL \u6269\u5c55\uff1a<\/p>\n<p><strong>\u65b9\u6cd5 1\uff1a\u4f7f\u7528 PECL \u5b89\u88c5<\/strong><\/p>\n<ol>\n<li>\u5b89\u88c5 PECL \u5b89\u88c5\u7a0b\u5e8f<\/li>\n<li>\u8fd0\u884c pecl install pdo_ <\/li>\n<li>\u7f16\u8bd1 PHP \u6269\u5c55<\/li>\n<\/ol>\n<p><strong>\u65b9\u6cd5 2\uff1a\u4f7f\u7528\u6269\u5c55\u7ba1\u7406\u5668<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00 php.ini \u6587\u4ef6<\/li>\n<li>\u627e\u5230 extension=pdo_mysql.so \u884c<\/li>\n<li>\u5982\u679c\u8be5\u884c\u4ee5\u5206\u53f7 (;) \u5f00\u5934\uff0c\u8bf7\u5c06\u5176\u5220\u9664<\/li>\n<li>\u4fdd\u5b58 php.ini \u6587\u4ef6<\/li>\n<li>\u91cd\u542f Web \u670d\u52a1\u5668<\/li>\n<\/ol>\n<p><strong>\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/strong><\/p>\n<p><strong>\u65b9\u6cd5 1\uff1a\u4f7f\u7528 PECL \u5b89\u88c5<\/strong><\/p>\n<ol>\n<li><strong>\u5b89\u88c5 PECL \u5b89\u88c5\u7a0b\u5e8f\uff1a<\/strong><\/li>\n<\/ol>\n<ul>\n<li>Windows\uff1a\u5b89\u88c5 PECL For Windows<\/li>\n<li>macOS\uff1abrew install php-pecl<\/li>\n<li>Linux\uff1a\u5b89\u88c5 PEAR<\/li>\n<\/ul>\n<ol>\n<li><strong>\u8fd0\u884c pecl install pdo_mysql\uff1a<\/strong><\/li>\n<\/ol>\n<ul>\n<li>Windows\uff1a\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8fd0\u884c pecl install pdo_mysql<\/li>\n<li>macOS\/Linux\uff1a\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c pecl install pdo_mysql<\/li>\n<\/ul>\n<ol>\n<li><strong>\u7f16\u8bd1 PHP \u6269\u5c55\uff1a<\/strong><\/li>\n<\/ol>\n<ul>\n<li>Windows\uff1a\u4f7f\u7528 Visual Studio \u7f16\u8bd1\u5668\u7f16\u8bd1 pdo_mysql.dll<\/li>\n<li>macOS\/Linux\uff1a\u8fd0\u884c phpize\uff0c\u7136\u540e .\/configure \u548c make<\/li>\n<\/ul>\n<p><strong>\u65b9\u6cd5 2\uff1a\u4f7f\u7528\u6269\u5c55\u7ba1\u7406\u5668<\/strong><\/p>\n<ol>\n<li>\u6253\u5f00 php.ini \u6587\u4ef6\u3002\u6587\u4ef6\u901a\u5e38\u4f4d\u4e8e\u4ee5\u4e0b\u4f4d\u7f6e\uff1a<\/li>\n<\/ol>\n<ul>\n<li>Windows\uff1aC:phpphp.ini<\/li>\n<li>macOS\uff1a\/etc\/php.ini<\/li>\n<li>Linux\uff1a\/etc\/php\/php.ini<\/li>\n<\/ul>\n<ol>\n<li>\u627e\u5230 extension=pdo_mysql.so \u884c\u3002<\/li>\n<li>\u5982\u679c\u8be5\u884c\u4ee5\u5206\u53f7 (;) \u5f00\u5934\uff0c\u8bf7\u5c06\u5176\u5220\u9664\u3002<\/li>\n<li>\u4fdd\u5b58 php.ini \u6587\u4ef6\u3002<\/li>\n<li>\u91cd\u542f Web \u670d\u52a1\u5668\u3002<\/li>\n<\/ol>\n<p>\u5f00\u542f MySQL \u6269\u5c55\u540e\uff0c\u60a8\u5c31\u53ef\u4ee5\u5728 PHP \u811a\u672c\u4e2d\u4f7f\u7528 MySQLi \u6216 PDO_MySQL \u51fd\u6570\u8fde\u63a5\u5230 MySQL \u6570\u636e\u5e93\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6269\u5c55\u600e\u4e48\u5f00\u542f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f00\u542f mysql \u6269\u5c55\u5171\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a \u4f7f\u7528 pecl \u5b89\u88c5\uff1a\u5b89\u88c5 pecl \u5b89\u88c5\u7a0b\u5e8f\uff0c\u8fd0\u884c pecl install pdo_mysql\uff0c\u7f16\u8bd1 php \u6269\u5c55\u3002 \u4f7f\u7528\u6269\u5c55\u7ba1\u7406\u5668\uff1a\u5728 php.ini \u4e2d\u627e\u5230\u5e76\u53d6\u6d88\u6ce8\u91ca extension=pdo_mysql.so \u884c\uff0c\u7136\u540e\u91cd\u542f web \u670d\u52a1\u5668\u3002 MySQL \u6269\u5c55\u5f00\u542f\u65b9\u6cd5 \u95ee\u9898\uff1a\u5982\u4f55\u5f00\u542f MySQL \u6269\u5c55\uff1f \u56de\u7b54\uff1a\u6709\u4e24\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5f00\u542f MySQL \u6269\u5c55\uff1a \u65b9\u6cd5 1\uff1a\u4f7f\u7528 PECL \u5b89\u88c5 \u5b89\u88c5 PECL \u5b89\u88c5\u7a0b\u5e8f \u8fd0\u884c pecl install pdo_ \u7f16\u8bd1 PHP \u6269\u5c55 \u65b9\u6cd5 2\uff1a\u4f7f\u7528\u6269\u5c55\u7ba1\u7406\u5668 \u6253\u5f00 php.ini \u6587\u4ef6 \u627e\u5230 extension=pdo_mysql.so \u884c \u5982\u679c\u8be5\u884c\u4ee5\u5206\u53f7 (;) \u5f00\u5934\uff0c\u8bf7\u5c06\u5176\u5220\u9664 \u4fdd\u5b58 php.ini [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-5122","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=5122"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5122\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}