{"id":10750,"date":"2022-08-16T23:11:55","date_gmt":"2022-08-16T15:11:55","guid":{"rendered":"https:\/\/blog.hoyo.idv.tw\/?p=10750"},"modified":"2022-08-16T23:11:55","modified_gmt":"2022-08-16T15:11:55","slug":"sqlstatehy000-2000-mysqlnd-cannot-connect-to-mysql-4-1-using-the-old-insecure-authentication","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=10750","title":{"rendered":"SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication."},"content":{"rendered":"<p>--<\/p>\n<h2>SQLSTATE[HY000] [2000] mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password').<\/h2>\n<ul>\n<li><a href=\"https:\/\/eric0806.blogspot.com\/2012\/06\/phpmysqlpassword.html\" target=\"_blank\" rel=\"noopener\">\u8001\u5b85\u7b46\u8a18\u672c: PHP\u9023\u63a5MySQL\u51fa\u73fePassword\u554f\u984c (eric0806.blogspot.com)<\/a><\/li>\n<li><a href=\"https:\/\/binndo.blogspot.com\/2016\/08\/phpmysqlcannot-connect-to-mysql-41.html\" target=\"_blank\" rel=\"noopener\">\u51b0\u8c46: PHP\u9023\u7ddaMySQL\u51fa\u73fe\u300ccannot connect to MySQL 4.1+ using the old insecure authentication\u300d (binndo.blogspot.com)<\/a><\/li>\n<\/ul>\n<p>\u5148\u78ba\u8a8d\u4e00\u4e0b\u662f\u5426\u771f\u7684\u662f 16 \u500b\u5b57\u7684\u5bc6\u78bc\u9577\u5ea6<\/p>\n<pre class=\"lang:default decode:true\">SELECT user, Length(Password) FROM mysql.user;<\/pre>\n<p>\u5982\u679c\u6709\u4fee\u6539\u6b0a\u9650\u8a66\u8457\u628a\u5bc6\u78bc\u6539\u6210\u65b0\u7248\u683c\u5f0f<\/p>\n<pre class=\"lang:default decode:true\">SET old_passwords = 0;\r\nSET PASSWORD FOR 'User'@'Host'=PASSWORD('password');\r\nFLUSH PRIVILEGES;<\/pre>\n<p>\u5982\u679c\u6c92\u6709\u64cd\u4f5c\u6b0a\u9650\uff0c\u5c31\u6309\u7167\u932f\u8aa4\u8a0a\u606f\u63d0\u793a\uff0c\u76f4\u63a5 SET PASSWORD \u91cd\u65b0\u8a2d\u5b9a\u5bc6\u78bc\u5f8c\u6e2c\u8a66\u770b\u770b<\/p>\n<p>--<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"10750\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;830&nbsp;total views, &nbsp;2&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>-- SQLSTATE[HY0...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"10750\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;830&nbsp;total views, &nbsp;2&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[258],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/10750"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10750"}],"version-history":[{"count":4,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/10750\/revisions"}],"predecessor-version":[{"id":10754,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/10750\/revisions\/10754"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10750"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}