{"id":583,"date":"2021-06-30T14:41:48","date_gmt":"2021-06-30T14:41:48","guid":{"rendered":"http:\/\/ictbank.ir\/blog\/?p=583"},"modified":"2023-05-01T16:09:59","modified_gmt":"2023-05-01T16:09:59","slug":"php-mysqli_connect-the-server-requested-authentication-method-unknown-to-the-client-caching_sha2_password","status":"publish","type":"post","link":"https:\/\/ictbank.ir\/blog\/php-mysqli_connect-the-server-requested-authentication-method-unknown-to-the-client-caching_sha2_password\/","title":{"rendered":"PHP: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password]"},"content":{"rendered":"\n<p>if you have these errors in your log file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nPHP Warning: mysqli_connect(): The server requested authentication method unknown to the client &#x5B;caching_sha2_password]\nPHP Warning: mysqli_connect(): (HY000\/2054): The server requested authentication method unknown to the client\n<\/pre><\/div>\n\n\n<p>It means that the server&#8217;s default authentication plugin is different from your client&#8217;s. So you have to change the user&#8217;s default authentication plugin by this command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nALTER USER &#039;username&#039;@&#039;localhost&#039; IDENTIFIED WITH mysql_native_password BY &#039;password&#039;;\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>if you have these errors in your log file: It means that the server&#8217;s default authentication plugin is different from your client&#8217;s. So you have to change the user&#8217;s default authentication plugin by this command:<\/p>\n","protected":false},"author":2,"featured_media":697,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,34],"tags":[],"class_list":["post-583","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database","category-mysql"],"_links":{"self":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/comments?post=583"}],"version-history":[{"count":1,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions"}],"predecessor-version":[{"id":584,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions\/584"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/media\/697"}],"wp:attachment":[{"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/media?parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/categories?post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ictbank.ir\/blog\/wp-json\/wp\/v2\/tags?post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}