{"id":2727,"date":"2025-06-11T00:24:18","date_gmt":"2025-06-10T20:24:18","guid":{"rendered":"https:\/\/yousite.ru\/?p=2727"},"modified":"2025-06-11T00:24:18","modified_gmt":"2025-06-10T20:24:18","slug":"pdo-connection-error-sqlstatehy0002054-server-sent-unknown-to-the-client","status":"publish","type":"post","link":"https:\/\/yousite.ru\/?p=2727","title":{"rendered":"PDO Connection Error: SQLSTATE[HY000][2054] Server sent unknown to the client"},"content":{"rendered":"\n<p>\u041f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043b \u0441\u0430\u0439\u0442\u044b \u0441\u043e \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 MySQL 8. \u0424\u043e\u0440\u0443\u043c\u044b \u043d\u0430 phpbb \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/strong><\/p>\n\n\n\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 MySQL 8 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043d\u0430 utf8mb4, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e \u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438.<\/p>\n\n\n\n<p>\u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 MySQL (\u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \/etc\/my.cnf \u0438\u043b\u0438 \/etc\/mysql\/conf.d\/my.cnf) \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043d\u0438\u0436\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \/etc\/mysql\/conf.d\/my.cnf\n\n&#91;mysqld]\n\ncollation-server = utf8_unicode_ci\ncharacter-set-server = utf8 \n\n# Otherwise the following exception will be thrown: the server requested authentication method unknown to the client\ndefault_authentication_plugin= mysql_native_password\n\n&#91;client] \ndefault-character-set=utf8 \n\n&#91;mysql]\ndefault-character-set=utf8<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 MySQL, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u043b\u0430\u0433\u0438\u043d\u0430:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>--- Update the authentication plugin of the user e.g for root with the password ---\nALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourRootPassword';\nALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'yourRootPassword';\nALTER USER 'default'@'%' IDENTIFIED WITH mysql_native_password BY 'yourRootPassword';\n\n--- Then flush the privileges ---\nFLUSH PRIVILEGES;<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0438\u0441:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service mysql restart<\/code><\/pre>\n\n\n\n<p><strong>\u0415\u0449\u0451 \u043e\u0434\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435:<\/strong><\/p>\n\n\n\n<p>\u041d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u0437\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e MySQL \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 8 \u0434\u043e MySQL 5.7<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043b \u0441\u0430\u0439\u0442\u044b \u0441\u043e \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 MySQL 8. \u0424\u043e\u0440\u0443\u043c\u044b \u043d\u0430 phpbb \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[139],"tags":[],"class_list":["post-2727","post","type-post","status-publish","format-standard","hentry","category-mysql"],"_links":{"self":[{"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/posts\/2727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yousite.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2727"}],"version-history":[{"count":1,"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/posts\/2727\/revisions"}],"predecessor-version":[{"id":2728,"href":"https:\/\/yousite.ru\/index.php?rest_route=\/wp\/v2\/posts\/2727\/revisions\/2728"}],"wp:attachment":[{"href":"https:\/\/yousite.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yousite.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yousite.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}