{"id":53,"date":"2008-06-11T11:13:26","date_gmt":"2008-06-11T11:13:26","guid":{"rendered":"http:\/\/tw.newtonstudio.com\/?p=53"},"modified":"2008-06-11T11:28:54","modified_gmt":"2008-06-11T11:28:54","slug":"mysql%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c-client-does-not-support-authentication-protocol-requested","status":"publish","type":"post","link":"https:\/\/tw.newtonstudio.com\/?p=53","title":{"rendered":"[MYSQL\u5e38\u898b\u554f\u984c] Client does not support authentication protocol requested"},"content":{"rendered":"<p>\u500b\u4eba\u6e2c\u8a66\u554f\u984c\u767c\u751f\u7684\u80cc\u666f\u5982\u4e0b:<br \/>\n\u74b0\u5883: Windows Server 2003<br \/>\n\u5148\u704cMYSQL 5.1 =&gt;OK<br \/>\n\u518d\u704cPHP4 =&gt;OK<br \/>\n\u704cPHPMYADMIN =&gt;\u8a2d\u5b9aSecret_blowfish OK=&gt;\u8dd1\u7684\u6642\u5019\u51fa\u73fe<\/p>\n<pre class=\"programlisting\">Client does not support authentication protocol requested\r\nby server; consider upgrading MySQL client\r\n\r\nMYSQL\u5b98\u65b9\u7684\u89e3\u6c7a\u65b9\u5f0f\u5982\u4e0b:<\/pre>\n<p>MySQL 5.0 uses an authentication protocol based           on a password hashing algorithm that is incompatible with that           used by older (pre-4.1) clients. If you upgrade the server           from 4.0, attempts to connect to it with an older client may           fail with the following message:<\/p>\n<p>shell&gt; <strong class=\"userinput\"><code>mysql<\/code><\/strong> Client does not support authentication protocol requested by server; consider upgrading MySQL client<\/p>\n<p>To solve this problem, you should use one of the following           approaches:<\/p>\n<div class=\"itemizedlist\">\n<ul>\n<li>Upgrade all client programs to use a 4.1.1 or newer client               library.<\/li>\n<li>When connecting to the server with a pre-4.1 client               program, use an account that still has a pre-4.1-style               password.<\/li>\n<li>Reset the password to pre-4.1 style for each user that               needs to use a pre-4.1 client program. This can be done               using the <code class=\"literal\">SET PASSWORD<\/code> statement and               the <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/encryption-functions.html#function_old-password\"><code class=\"literal\">OLD_PASSWORD()<\/code><\/a> function:\n<pre class=\"programlisting\">mysql&gt; <strong class=\"userinput\"><code>SET PASSWORD FOR<\/code><\/strong>\r\n-&gt; <strong class=\"userinput\"><code>'<em class=\"replaceable\"><code>some_user<\/code><\/em>'@'<em class=\"replaceable\"><code>some_host<\/code><\/em>' = OLD_PASSWORD('<em class=\"replaceable\"><code>newpwd<\/code><\/em>');<\/code><\/strong><\/pre>\n<p>Alternatively, use <code class=\"literal\">UPDATE<\/code> and               <code class=\"literal\">FLUSH PRIVILEGES<\/code>:<\/p>\n<pre class=\"programlisting\">mysql&gt; <strong class=\"userinput\"><code>UPDATE mysql.user SET Password = OLD_PASSWORD('<em class=\"replaceable\"><code>newpwd<\/code><\/em>')<\/code><\/strong>\r\n-&gt; <strong class=\"userinput\"><code>WHERE Host = '<em class=\"replaceable\"><code>some_host<\/code><\/em>' AND User = '<em class=\"replaceable\"><code>some_user<\/code><\/em>';<\/code><\/strong>\r\nmysql&gt; <strong class=\"userinput\"><code>FLUSH PRIVILEGES;<\/code><\/strong><\/pre>\n<p>Substitute the password you want to use for               \u201c<span class=\"quote\"><em class=\"replaceable\"><code>newpwd<\/code><\/em><\/span>\u201d in the               preceding examples. MySQL cannot tell you what the               original password was, so you&#8217;ll need to pick a new one.<\/li>\n<li>Tell the server to use the older password hashing               algorithm:\n<div class=\"orderedlist\">\n<ol type=\"1\">\n<li>Start <span><strong class=\"command\">mysqld<\/strong><\/span> with the                   <code class=\"option\">--old-passwords<\/code> option.<\/li>\n<li>Assign an old-format password to each account that has                   had its password updated to the longer 4.1 format. You                   can identify these accounts with the following query:\n<pre class=\"programlisting\">mysql&gt; <strong class=\"userinput\"><code>SELECT Host, User, Password FROM mysql.user<\/code><\/strong>\r\n-&gt; <strong class=\"userinput\"><code>WHERE LENGTH(Password) &gt; 16;<\/code><\/strong><\/pre>\n<p>For each account record displayed by the query, use                   the <code class=\"literal\">Host<\/code> and                   <code class=\"literal\">User<\/code> values and assign a password                   using the                   <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/encryption-functions.html#function_old-password\"><code class=\"literal\">OLD_PASSWORD()<\/code><\/a> function and either <code class=\"literal\">SET PASSWORD<\/code> or                   <code class=\"literal\">UPDATE<\/code>, as described earlier.<\/li>\n<\/ol>\n<\/div>\n<\/li>\n<\/ul>\n<\/div>\n<div class=\"note\" style=\"margin-left: 0.5in; margin-right: 0.5in;\">\n<h3 class=\"title\">Note<\/h3>\n<p>In older versions of PHP, the <code class=\"literal\">mysql<\/code> extension does not support the authentication protocol in             MySQL 4.1.1 and higher. This is true regardless of the PHP             version being used. If you wish to use the             <code class=\"literal\">mysql<\/code> extension with MySQL 4.1 or newer,             you may need to follow one of the options discussed above             for configuring MySQL to work with old clients. The             <code class=\"literal\">mysqli<\/code> extension (stands for &#8220;MySQL,             Improved&#8221;; added in PHP 5) is compatible with the improved             password hashing employed in MySQL 4.1 and higher, and no             special configuration of MySQL need be done to use this             MySQL client library. For more information about the             <code class=\"literal\">mysqli<\/code> extension, see             <a href=\"http:\/\/php.net\/mysqli\" target=\"_top\">http:\/\/php.net\/mysqli<\/a>.<\/p>\n<\/div>\n<p>It may also be possible to compile the older           <code class=\"literal\">mysql<\/code> extension against the new MySQL           client library. This is beyond the scope of this Manual;           consult the PHP documentation for more information. You also           be able to obtain assistance with these issues in our           <a href=\"http:\/\/forums.mysql.com\/list.php?52\" target=\"_top\">MySQL with PHP           forum<\/a>.<\/p>\n<p>For additional background on password hashing and           authentication, see <a title=\"5.4.9. Password Hashing as of MySQL 4.1\" href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/password-hashing.html\">Section 5.4.9, \u201cPassword Hashing as of MySQL 4.1\u201d<\/a>.<\/p>\n<p>\u5f8c\u4f86\u8a66\u4e86\u4e4b\u5f8c\u5c31\u53ef\u4ee5RUN\u4e86, \u5982\u679c\u5404\u4f4d\u4e5f\u9047\u5230\u9019\u500b\u60c5\u6cc1\u4e0d\u59a8\u8a66\u8a66.<\/p>\n<p>\u4e3b\u8981\u662f\u91dd\u5c0d\u4e0d\u540c\u7684\u5e33\u6236, \u53ef\u80fd\u662f\u7248\u672c\u7684\u554f\u984c, \u53ea\u8981\u8a2d\u5b9aOLD_PASSWORD, \u518dFLUSH\u4e00\u6b21MYSQL\u61c9\u8a72\u5c31\u6c92\u554f\u984c\u4e86.<\/p>\n<p>\u539f\u6587\u53ef\u53c3\u8003: http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/old-client.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u500b\u4eba\u6e2c\u8a66\u554f\u984c\u767c\u751f\u7684\u80cc\u666f\u5982\u4e0b: \u74b0\u5883: Windows Server 2003 \u5148\u704cMYSQL 5.1 =&#038;gt [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-mysql-"],"_links":{"self":[{"href":"https:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=53"}],"version-history":[{"count":0,"href":"https:\/\/tw.newtonstudio.com\/index.php?rest_route=\/wp\/v2\/posts\/53\/revisions"}],"wp:attachment":[{"href":"https:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tw.newtonstudio.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}