{"id":51,"date":"2013-01-28T10:33:50","date_gmt":"2013-01-28T10:33:50","guid":{"rendered":"http:\/\/blog.klug.me\/?p=51"},"modified":"2014-05-26T06:40:49","modified_gmt":"2014-05-26T06:40:49","slug":"php-warning-mysql_connect-client-does-not-support-authentication-protocol-requested-by-server","status":"publish","type":"post","link":"https:\/\/blog.klug.me\/?p=51","title":{"rendered":"PHP Warning:  mysql_connect(): Client does not support authentication protocol requested by server;"},"content":{"rendered":"<p>For some reasons we have very old hard and software here at work.<br \/>\nI had the problem that we&#8217;ve upgraded our database servers from MySQL 4.x to MySQL 5.x.<\/p>\n<p>But there is a very old provisioning tool which does not support PHP5 and so we&#8217;re stuck with an old PHP4 and a new MySQL 5 Database.<br \/>\nIf we try to connect to the database the following error occures:<\/p>\n<pre>PHP Warning: \u00a0mysql_connect(): Client does not support authentication protocol requested by server;<\/pre>\n<p>I know, the only correct way is to change our program to support PHP5, but there are no resources left for this change and this is not my decision.<\/p>\n<p><!--more--><\/p>\n<p>So I have searched the internet how I can get it to work and have found a really easy way:<\/p>\n<pre>mysql&gt; GRANT USAGE ON *.* TO '[username]'@'%';\r\nmysql&gt; SET PASSWORD FOR '[username]'@'%' = OLD_PASSWORD('[password]');<\/pre>\n<p>This (OLD_PASSWORD()) enables the user to login with an old password wich is not supported in newer MySQL versions by default.<br \/>\n[username] and [password] has to get replaced by your own values.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For some reasons we have very old hard and software here at work. I had the problem that we&#8217;ve upgraded our database servers from MySQL 4.x to MySQL 5.x. But there is a very old provisioning tool which does not support PHP5 and so we&#8217;re stuck with an old PHP4 and a new MySQL 5 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,8],"tags":[],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-databases","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.klug.me\/index.php?rest_route=\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.klug.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.klug.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.klug.me\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.klug.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=51"}],"version-history":[{"count":6,"href":"https:\/\/blog.klug.me\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions"}],"predecessor-version":[{"id":122,"href":"https:\/\/blog.klug.me\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions\/122"}],"wp:attachment":[{"href":"https:\/\/blog.klug.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.klug.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.klug.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}