{"id":1086,"date":"2023-03-28T01:30:35","date_gmt":"2023-03-27T17:30:35","guid":{"rendered":"https:\/\/www.nmking.io\/?p=1086"},"modified":"2025-12-20T23:14:18","modified_gmt":"2025-12-20T15:14:18","slug":"%e5%ae%89%e8%a3%9dapach-mysql-php%e5%8f%8aphpmyadmin%ef%bc%8c%e8%a8%ad%e5%ae%9amysql-root%e5%af%86%e7%a2%bc%e5%a4%b1%e6%95%97","status":"publish","type":"post","link":"https:\/\/www.nmking.io\/index.php\/2023\/03\/28\/1086\/","title":{"rendered":"\u5b89\u88ddapach, mysql, php\u53caphpmyadmin\uff0c\u8a2d\u5b9amysql root\u5bc6\u78bc\u5931\u6557"},"content":{"rendered":"\n<p>\u4eca\u5929\u5728Ubuntu\u5b89\u88dd\u7cfb\u7d71\uff0c\u4f9d\u7167\u9019\u56db\u500b\u7db2\u9801\u7684\u6559\u5b78\u5206\u5225\u8a2d\u5b9aapach, mysql, php, phpmyadmin<\/p>\n\n\n\n<p>1. apach\uff1a<a href=\"https:\/\/ui-code.com\/archives\/179\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/ui-code.com\/archives\/179<\/a><\/p>\n\n\n\n<p>2. mysql\uff1a<a href=\"https:\/\/ui-code.com\/archives\/293\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/ui-code.com\/archives\/293<\/a><\/p>\n\n\n\n<p>3. php\uff1a<a href=\"https:\/\/ui-code.com\/archives\/286\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/ui-code.com\/archives\/286<\/a><\/p>\n\n\n\n<p>4. phpmyadmin\uff1a<a href=\"https:\/\/ui-code.com\/archives\/297\" rel=\"noreferrer noopener\" target=\"_blank\">https:\/\/ui-code.com\/archives\/297<\/a><\/p>\n\n\n\n<p>\u57282.\u5b89\u88ddMysql\u5f8c\uff0c\u8981\u555f\u52d5\u5bc6\u78bc\u8a2d\u5b9a\u7d50\u679c\u5931\u6557\uff0c\u932f\u8aa4\u8a0a\u606f\u662f\uff1a<\/p>\n\n\n\n<p>&#8220;MySQL Failed! Error: SET PASSWORD has no significance for user \u2018root\u2019@\u2019localhost\u2019 as the authentication method used doesn\u2019t store authentication data in the MySQL server. Please consider using ALTER USER&#8221;<\/p>\n\n\n\n<p>\u641c\u5c0b\u4e00\u4e0b<a href=\"https:\/\/www.nixcraft.com\/t\/mysql-failed-error-set-password-has-no-significance-for-user-root-localhost-as-the-authentication-method-used-doesnt-store-authentication-data-in-the-mysql-server-please-consider-using-alter-user\/4233\/2\" rel=\"noreferrer noopener\" target=\"_blank\">\u6587\u7ae0\u5f8c<\/a>\uff0c\u9019\u6a23\u505a\u5373\u53ef<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u518d\u958b\u555f\u53e6\u5916\u7684terminal\u8996\u7a97\uff0c\u56e0\u70ba\u73fe\u5728\u7684\u8996\u7a97\u88ab\u8f38\u5165\u5bc6\u78bc\u5361\u6b7b\u4e86\uff0c\u8df3\u4e0d\u51fa\u4f86<\/li>\n\n\n\n<li>\u95dc\u9589\u4e0a\u4e00\u6b21\u5bc6\u78bc\u8a2d\u5b9a\u57f7\u884c\u7dd2\uff1a<mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\">sudo killall -9 mysql_secure_installation<\/mark><\/li>\n\n\n\n<li>\u9032\u5165Mysql\uff1a<mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\">sudo mysql<\/mark><\/li>\n\n\n\n<li>\u5728Mysql\u547d\u4ee4\u4e2d\u8f38\u5165\uff1a<br><mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\">ALTER USER &#8216;root&#8217;@&#8217;localhost&#8217; IDENTIFIED WITH mysql_native_password BY &#8216;\u4f60\u7684\u65b0\u5bc6\u78bc&#8217;;<\/mark><\/li>\n\n\n\n<li>\u9000\u51faMysql\u547d\u4ee4\uff1a<mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\">exit<\/mark><\/li>\n\n\n\n<li>\u91cd\u65b0\u9032\u5165\u5bc6\u78bc\u8a2d\u5b9a\uff1a<mark style=\"background-color:#000000\" class=\"has-inline-color has-white-color\">sudo mysql_secure_installation<\/mark><\/li>\n<\/ol>\n\n\n\n<p>\u6700\u5f8c\u8981\u8a18\u5f97\u628aphpmyadmin\u7684\u5c0d\u5916\u529f\u80fd\u95dc\u9589\uff0c\u4fee\u6539\/etc\/phpmyadmin\/apache.conf<\/p>\n\n\n\n<p>\u5728&lt;\/IfModule&gt;\u4e0b\u65b9\u8f38\u5165\u4ee5\u4e0b\u6587\u5b57\u5373\u53ef<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Alias \/phpmyadmin \/usr\/share\/phpmyadmin\n\n&lt;Directory \/usr\/share\/phpmyadmin&gt;\n    Options FollowSymLinks\n    DirectoryIndex index.php\n\n    &lt;IfModule mod_php5.c&gt;\n           ......\n    &lt;\/IfModule&gt;\n<strong>    Order Deny,Allow\n    Deny from all\n    Allow from 127.0.0.1<\/strong>\n&lt;\/Directory&gt;<\/code><\/pre>\n\n\n\n<p>phpmyadmin\u5982\u679c\u932f\u8aa4\uff0c\u53ef\u80fd\u662f\u6c92\u6709\u6307\u5b9a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Not Found The requested URL was not found on this server.<\/code><\/pre>\n\n\n\n<p>\u9019\u6642\u5019\u8f38\u5165 sudo nano \/etc\/apache2\/conf-available\/phpmyadmin.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Alias \/phpmyadmin \/usr\/share\/phpmyadmin\r\n\r\n&lt;Directory \/usr\/share\/phpmyadmin>\r\n    Options SymLinksIfOwnerMatch\r\n    DirectoryIndex index.php\r\n    Require all granted\r\n&lt;\/Directory>\r\n<\/code><\/pre>\n\n\n\n<p>phpmyadmin\u5c0dmysql\u7684\u5bc6\u78bc\u53ef\u5229\u7528\u4ee5\u4e0b\u6307\u4ee4\u5efa\u7acb<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql\r\nCREATE USER '\u5e33\u865f'@'localhost' IDENTIFIED BY '\u4e00\u7d44\u4f60\u81ea\u5df1\u8a2d\u5b9a\u7684\u5f37\u5bc6\u78bc';\r\nGRANT ALL PRIVILEGES ON *.* TO '\u5e33\u865f'@'localhost' WITH GRANT OPTION;\r\nFLUSH PRIVILEGES;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u5728Ubuntu\u5b89\u88dd\u7cfb\u7d71\uff0c\u4f9d\u7167\u9019\u56db\u500b\u7db2\u9801\u7684\u6559\u5b78\u5206\u5225\u8a2d\u5b9aapach, mysql, php, phpmyadm [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6,8],"tags":[],"class_list":["post-1086","post","type-post","status-publish","format-standard","hentry","category-js","category-computer"],"blocksy_meta":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/1086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/comments?post=1086"}],"version-history":[{"count":7,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/1086\/revisions"}],"predecessor-version":[{"id":2395,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/1086\/revisions\/2395"}],"wp:attachment":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/media?parent=1086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/categories?post=1086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/tags?post=1086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}