{"id":2602,"date":"2018-09-11T10:15:11","date_gmt":"2018-09-11T02:15:11","guid":{"rendered":"https:\/\/www.webteach.tw\/?p=2602"},"modified":"2018-09-11T10:15:11","modified_gmt":"2018-09-11T02:15:11","slug":"linux-ubuntu-18-04-lts-install-apache2-php7-2-mysql-phpmyadmin","status":"publish","type":"post","link":"https:\/\/www.webteach.tw\/?p=2602","title":{"rendered":"[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \/ php7.2 \/ mysql \/ phpmyadmin"},"content":{"rendered":"<p>\t\t\t\tUbuntu 18.04 LTS install apache2 \/ php7.2 \/ mysql \/ phpmyadmin<br \/>\n<!--more--><br \/>\n\u5148\u88ddphp7.2 apache2<br \/>\n\u6307\u4ee4\uff1aapt install php<br \/>\n\u4ee5\u4e0a\u6307\u4ee4\u6703\u5b89\u88dd\u4ee5\u4e0b\u5957\u4ef6<br \/>\napache2 apache2-bin apache2-data apache2-utils libapache2-mod-php7.2 libapr1<br \/>\nlibaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap php-common php7.2<br \/>\nphp7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-readline<br \/>\n\u518d\u4f86\u5b89\u88dd mysql<br \/>\n\u6307\u4ee4\uff1aapt install mysql-server<br \/>\n\u4ee5\u4e0a\u6307\u4ee4\u6703\u5b89\u88dd\u4ee5\u4e0b\u5957\u4ef6<br \/>\nlibaio1 libevent-core-2.1-6 libhtml-template-perl mysql-client-5.7<br \/>\nmysql-client-core-5.7 mysql-server-5.7 mysql-server-core-5.7<br \/>\n\u88dd\u8cc7\u6599\u5eab\u7ba1\u7406\u5de5\u5177 phpmyadmin<br \/>\napt install phpmyadmin<br \/>\n\u5148\u9078\u64c7 \u9078 apache<br \/>\n\u518d\u5efa\u7acb\u8cc7\u6599\u5eab\u7ba1\u7406\u8005\u5bc6\u78bc<br \/>\n\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u518d\u57f7\u884c\u4ee5\u4e0b\u6b65<br \/>\n\u5c07phpmyadmin \u8a2d\u5b9a\u6a94\u52a0\u5165\u5230 apache\u8a2d\u5b9a\u6a94\u4e2d<br \/>\n\u7de8\u8f2f\u8a72\u6a94\u6848 \/etc\/apache2\/apache2.conf<br \/>\n\u65bc\u6587\u4ef6\u5c3e\u52a0\u5165 Include \/etc\/phpmyadmin\/apache.conf<br \/>\n\u4f60\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4e0b\u6307\u4ee4 \u5beb\u5165\u8a2d\u5b9a\u6a94<br \/>\necho &#8220;Include \/etc\/phpmyadmin\/apache.conf&#8221; &gt;&gt; \/etc\/apache2\/apache2.conf<br \/>\n\u8a2d\u5b9a\u5b8c\u6210\u5f8c\u9700\u91cd\u555fapache<br \/>\nsudo service apache2 restart<br \/>\n\u518d\u4f86\u8f38\u5165\u7db2\u5740 http:\/\/127.0.0.1\/phpmyadmin<br \/>\n\u6703\u767c\u73fe\u8f38\u5165\u5e33\u5bc6 root \/ password \u51fa\u73fe<br \/>\n\u539f\u4f86\u662f\u9019\u500b\u7248\u672c\u4e0d\u5141\u8a31\u7528root\u767b\u5165phpmyadmin, \u4f60\u5fc5\u9700\u53e6\u5916\u5efa\u7acb\u4e00\u500b\u5e33\u865f\/\u5bc6\u78bc \u7d66\u4e88\u6700\u9ad8\u6b0a\u9650\u624d\u53ef\u4ee5\u3002<br \/>\n\u4f60\u53ef\u4ee5\u5728\u6307\u4ee4\u8996\u7a97 \u5207\u5230root\u6b0a\u9650\uff0c\u4e0bmysql \u5c31\u53ef\u4ee5\u767b\u5165\uff0c\u518d\u65b0\u589e\u53e6\u4e00\u500b\u5e33\u5bc6\u505a\u7ba1\u7406\u5e33\u865f<br \/>\n\u4ee5root\u767b\u5165mysql \u6307\u4ee4\uff1amysql -u root -p<\/p>\n<pre><code>CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_pass';\nGRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;\nFLUSH PRIVILEGES;<\/code><\/pre>\n<p>\u89e3\u6cd5\u5982\u7db2\u5740<a href=\"https:\/\/askubuntu.com\/questions\/763336\/cannot-enter-phpmyadmin-as-root-mysql-5-7\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/askubuntu.com\/questions\/763336\/cannot-enter-phpmyadmin-as-root-mysql-5-7<\/a><br \/>\n\u82e5\u767c\u73fe\u7528\u525b\u5efa\u7684\u5e33\u865f\u53ef\u4ee5\u767b\u5165\u4f46\u78ba\u4e0d\u80fd\u5efa\u7acb\u8cc7\u6599\u5eab\u6709\u53ef\u80fd\u662f\u6b0a\u9650\u6c92\u8a2d\u597d\uff0c\u53ef\u4ee5\u53c3\u8003\u4ee5\u4e0b\u9023\u7d50<br \/>\n<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-create-a-new-user-and-grant-permissions-in-mysql<\/a><br \/>\n\u6216\u76f4\u63a5\u57f7\u884c\u4ee5\u4e0b\u6307\u4ee4\uff1a<br \/>\nGRANT ALL PRIVILEGES ON * . * TO &#8216;phpmyadmin&#8217;@&#8217;localhost&#8217;;<br \/>\nFLUSH PRIVILEGES;\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 18.04 LTS install &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[370,577],"class_list":["post-2602","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-ubuntu-18-04"],"_links":{"self":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/2602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2602"}],"version-history":[{"count":0,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=\/wp\/v2\/posts\/2602\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webteach.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}