
{"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":"<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div><div style=\"margin-top: 0px; margin-bottom: 0px;\" class=\"sharethis-inline-share-buttons\" ><\/div><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<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>Ubuntu 18.04 LTS ins [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","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"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \/ php7.2 \/ mysql \/ phpmyadmin - \u6df7\u6c34\u6478\u9b5a<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webteach.tw\/?p=2602\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \/ php7.2 \/ mysql \/ phpmyadmin - \u6df7\u6c34\u6478\u9b5a\" \/>\n<meta property=\"og:description\" content=\"Ubuntu 18.04 LTS ins [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webteach.tw\/?p=2602\" \/>\n<meta property=\"og:site_name\" content=\"\u6df7\u6c34\u6478\u9b5a\" \/>\n<meta property=\"article:published_time\" content=\"2018-09-11T02:15:11+00:00\" \/>\n<meta name=\"author\" content=\"jeff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005:\" \/>\n\t<meta name=\"twitter:data1\" content=\"jeff\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9810\u4f30\u95b1\u8b80\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\u9418\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=2602#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=2602\"},\"author\":{\"name\":\"jeff\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\"},\"headline\":\"[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \\\/ php7.2 \\\/ mysql \\\/ phpmyadmin\",\"datePublished\":\"2018-09-11T02:15:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=2602\"},\"wordCount\":128,\"commentCount\":0,\"keywords\":[\"linux\",\"Ubuntu 18.04\"],\"articleSection\":[\"Linux\"],\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.webteach.tw\\\/?p=2602#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=2602\",\"url\":\"https:\\\/\\\/www.webteach.tw\\\/?p=2602\",\"name\":\"[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \\\/ php7.2 \\\/ mysql \\\/ phpmyadmin - \u6df7\u6c34\u6478\u9b5a\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#website\"},\"datePublished\":\"2018-09-11T02:15:11+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=2602#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.webteach.tw\\\/?p=2602\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/?p=2602#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9801\",\"item\":\"https:\\\/\\\/www.webteach.tw\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \\\/ php7.2 \\\/ mysql \\\/ phpmyadmin\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#website\",\"url\":\"https:\\\/\\\/www.webteach.tw\\\/\",\"name\":\"\u6df7\u6c34\u6478\u9b5a\",\"description\":\"\u5b78\u7121\u6b62\u5883,\u6559\u5b78\u76f8\u9577\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.webteach.tw\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-TW\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.webteach.tw\\\/#\\\/schema\\\/person\\\/d434d754fd581338113eecfa923d7520\",\"name\":\"jeff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g\",\"caption\":\"jeff\"},\"sameAs\":[\"http:\\\/\\\/35.72.55.111\"],\"url\":\"https:\\\/\\\/www.webteach.tw\\\/?author=1\"},false]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \/ php7.2 \/ mysql \/ phpmyadmin - \u6df7\u6c34\u6478\u9b5a","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webteach.tw\/?p=2602","og_locale":"zh_TW","og_type":"article","og_title":"[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \/ php7.2 \/ mysql \/ phpmyadmin - \u6df7\u6c34\u6478\u9b5a","og_description":"Ubuntu 18.04 LTS ins [&hellip;]","og_url":"https:\/\/www.webteach.tw\/?p=2602","og_site_name":"\u6df7\u6c34\u6478\u9b5a","article_published_time":"2018-09-11T02:15:11+00:00","author":"jeff","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005:":"jeff","\u9810\u4f30\u95b1\u8b80\u6642\u9593":"1 \u5206\u9418"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webteach.tw\/?p=2602#article","isPartOf":{"@id":"https:\/\/www.webteach.tw\/?p=2602"},"author":{"name":"jeff","@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520"},"headline":"[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \/ php7.2 \/ mysql \/ phpmyadmin","datePublished":"2018-09-11T02:15:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webteach.tw\/?p=2602"},"wordCount":128,"commentCount":0,"keywords":["linux","Ubuntu 18.04"],"articleSection":["Linux"],"inLanguage":"zh-TW","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webteach.tw\/?p=2602#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webteach.tw\/?p=2602","url":"https:\/\/www.webteach.tw\/?p=2602","name":"[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \/ php7.2 \/ mysql \/ phpmyadmin - \u6df7\u6c34\u6478\u9b5a","isPartOf":{"@id":"https:\/\/www.webteach.tw\/#website"},"datePublished":"2018-09-11T02:15:11+00:00","author":{"@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520"},"breadcrumb":{"@id":"https:\/\/www.webteach.tw\/?p=2602#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webteach.tw\/?p=2602"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webteach.tw\/?p=2602#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9801","item":"https:\/\/www.webteach.tw\/"},{"@type":"ListItem","position":2,"name":"[ Linux ] \u2013 Ubuntu 18.04 LTS install apache2 \/ php7.2 \/ mysql \/ phpmyadmin"}]},{"@type":"WebSite","@id":"https:\/\/www.webteach.tw\/#website","url":"https:\/\/www.webteach.tw\/","name":"\u6df7\u6c34\u6478\u9b5a","description":"\u5b78\u7121\u6b62\u5883,\u6559\u5b78\u76f8\u9577","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webteach.tw\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-TW"},{"@type":"Person","@id":"https:\/\/www.webteach.tw\/#\/schema\/person\/d434d754fd581338113eecfa923d7520","name":"jeff","image":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5797200e421b670a2ce64d6e7382054c69b231d4aab55742c96bb1e51bc9fefc?s=96&d=mm&r=g","caption":"jeff"},"sameAs":["http:\/\/35.72.55.111"],"url":"https:\/\/www.webteach.tw\/?author=1"},false]}},"views":886,"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":0,"sum_votes":0},"_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}]}}