﻿{"id":1586,"date":"2011-05-08T18:49:03","date_gmt":"2011-05-08T10:49:03","guid":{"rendered":"http:\/\/blog.jixin.ntxz.net\/?p=1586"},"modified":"2011-05-08T18:49:03","modified_gmt":"2011-05-08T10:49:03","slug":"ubuntu-%e7%94%a8apt-get%e6%96%b9%e6%b3%95%e5%ae%89%e8%a3%85mysql5-apache2-php5%ef%bc%8bphpmyadmin","status":"publish","type":"post","link":"http:\/\/www.ntxz.net\/?p=1586","title":{"rendered":"Ubuntu \u7528apt-get\u65b9\u6cd5\u5b89\u88c5mysql5 + Apache2 + PHP5\uff0bPhpmyadmin"},"content":{"rendered":"<p>\u7528apt-get\u65b9\u6cd5\u5b89\u88c5mysql5 + Apache2 + PHP5\uff0bPhpmyadmin\uff1a <\/p>\n<p>\u5927\u5bb6\u8bf7\u5148\u770b\u4e0bUbuntu\u7684WIKI\uff0c\uff08http:\/\/wiki.ubuntu.org\uff09\u4e0a\u9762\u8bb2\u7684\u5f88\u8be6\u7ec6\u7684\u3002\u4f46\u672c\u4eba\u6309\u4e0a\u9762\u505a\u7684\u7b2c\u4e00\u6b21\u6ca1\u6709\u6210\u529f\u3002apache2,php5,mysql5\u90fd\u53ef\u4ee5\u8fd0\u884c\uff0c\u5c31\u662fphpmyadmin\u4e0d\u80fd\u7528\u3002<br \/>\n\u672c\u4eba\u5f97\u5230\u7684\u7ecf\u9a8c\u662f\uff1aMYSQL\u5b89\u6210\u529f\u540e\uff0c\u4e00\u5b9a\u8981\u5148\u7ed9\u5b83\u8bbe\u4e2a\u5bc6\u7801\uff0c\u8fd9\u4e0a\u6b65\u662f\u4e0d\u53ef\u5c11\u7684\u3002<br \/>\n\u6b64\u7bc7\u53ea\u4ee3\u8868\u4e2a\u4eba\u7684\u89c2\u70b9\u548c\u7ecf\u9a8c\uff0c\u53ef\u80fd\u4f1a\u7247\u9762\u5316\u548c\u6709\u9519\u8bef\uff0c\u8bf7\u5927\u5bb6\u6279\u8bc4\u6307\u6b63\uff0c\u6709\u95ee\u9898\u5927\u5bb6\u4e00\u8d77\u6765\u8ba8\u8bba\uff01\uff01 <\/p>\n<p>1 .\u8981\u7528apt-get\u7684\u65b9\u5f0f\u5b89\u88c5\uff0c\u6700\u597d\uff0c\u4e5f\u53ef\u80fd\u662f\u5fc5\u987b\u5148\u8fd0\u884c\u4e0b\u9762\u5728\u547d\u4ee4\u5347\u7ea7\u81ea\u5df1\u7684\u7cfb\u7edf\uff0c\u6211\u7684\u5c31\u53ea\u80fd\u5148\u5347\u7ea7\u540e\u624d\u80fd\u5b89\u88c5mysql5 + Apache2 + PHP5\u7684\u3002<br \/>\n\u6211\u5728\u6ca1\u5347\u7ea7\u524d\u8fd0\u884csudo apt-get install apache2 php5 mysql-server \u662f\u6ca1\u6709\u7528\u7684\u3002\u800c\u5982\u679c\u4f60\u627e\u7684\u6e90\u4e0d\u597d\u6216\u662f\u4f60\u7684\u7f51\u7edc\u4e0d\u7a33\u5b9a\u7684\u8bdd\uff0c\u4f60\u4e5f\u6709\u53ef\u80fd\u5347\u7ea7\u4e0d\u6210\u3002\u8fd9\u6837\u7684\u8bdd\uff0c\u4f60\u60f3\u7528apt-get\u7684\u65b9\u5f0f\u6765\u5b89\u88c5\u4e00\u4e9b\u8f6f\u4ef6\u65f6\u53ef\u80fd\u662f\u4e0d\u80fd\u5b89\u88c5\u7684\u3002<br \/>\nsudo apt-get update<br \/>\nsudo apt-get dist-upgrade <\/p>\n<p>2.\u5b89\u88c5\uff1a<br \/>\nsudo apt-get install mysql-server<br \/>\n\u5b89\u88c5\u4e0amysql5<br \/>\nsudo apt-get install apache2<br \/>\n\u5b89\u88c5apache2<br \/>\nsudo apt-get install php5<br \/>\n\u5b89\u88c5php5<br \/>\nsudo apt-get install php5-mysql<br \/>\n\u5b89\u88c5php\u7684mysql\u6a21\u5757<br \/>\nsudo apt-get install php5-gd<br \/>\n\u5b89\u88c5GD\u5e93<br \/>\n\u5728\u8fd0\u884c\u4e0a\u9762\u7684\u547d\u4ee4\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u7559\u5fc3\u770b\u4e0blibapache2-mod-auth-mysql\uff08\u5b89\u88c5apache2\u65f6\u53ef\u80fd\u4f1a\u5b89\u4e0a\uff09\u548clibapache2-mod-php5,\u5982\u679c\u770b\u5230\u5b89\u4e0a\u4e86\u5c31\u4e0d\u7528\u518d\u5355\u72ec\u5b89\u88c5\u4e86\u3002 <\/p>\n<p>3 . \u914d\u7f6e\uff1a <\/p>\n<p>\u6211\u4eec\u521a\u5b89\u88c5\u4e0a\u7684MYSQL\uff0c\u53ea\u6709\u4e00\u4e2a\u7cfb\u7edf\u9ed8\u8ba4\u7684root\u7528\u6237\uff0c\u800c\u4e14\u662f\u6ca1\u6709\u5bc6\u7801\u7684\uff0c\u6b64\u65f6\u6211\u4eec\u4e00\u5b9a\u8981\u7ed9MYSQL\u8bbe\u7f6e\u4e00\u4e2a\u5bc6\u7801\uff0c\u4e2a\u4eba\u8ba4\u4e3a\u4e00\u5b9a\u8981\u7684\u3002\u56e0\u4e3a\u6211\u7b2c\u4e00\u6b21\u5b89\u88c5\u65f6\u5c31\u662f\u6ca1\u6709\u641e\u8fd9\u4e00\u6b65\uff0c\u8ba4\u4e3a\u548cwin\u4e0b\u7684\u4e00\u6837\uff0c\u53ef\u5148\u4e0d\u7528\u8bbe\u7f6e\u3002\u53ef\u662f\u5f53\u6211\u5728http:\/\/127.0.0.1\/phpmyadmin\u4e0b\u7528root\u4e0d\u5e26\u5bc6\u7801\u767b\u9646\u65f6\u600e\u6837\u4e5f\u4e0d\u4f1a\u6210\u529f\uff01<br \/>\n\u7ec8\u7aef\u4e0b\u8f93\u5165\uff1a<br \/>\nmysql -u root<br \/>\nmysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY &#8220;123456&#8221;;<br \/>\n\u2019123456\u2018\u662froot\u7684\u5bc6\u7801\uff0c\u53ef\u4ee5\u81ea\u7531\u8bbe\u7f6e\uff0c\u4f46\u6700\u597d\u662f\u8bbe\u4e2a\u5b89\u5168\u70b9\u7684\u3002<br \/>\nmysql>\\q \u9000\u51famysql <\/p>\n<p>mysql\u7684\u914d\u7f6e\u6587\u4ef6-my.cnf:(\u8def\u5f84\uff1a\/etc\/mysql\/my.cnf)<br \/>\n\u8fd0\u884c\u547d\u4ee4\uff1asudo gedit \/etc\/mysql\/my.cnf\u53ef\u7f16\u8f91\u3002 <\/p>\n<p>apache2\u7684\u914d\u7f6e\u6587\u4ef6-apache2.conf(\u8def\u5f84\uff1a\/etc\/apache2\/apache2.conf)<br \/>\n\u8fd0\u884c\u547d\u4ee4\uff1asudo gedit \/etc\/apache2.conf\u53ef\u7f16\u8f91 <\/p>\n<p>PHP\u7684\u914d\u7f6e\u6587\u4ef6-php.ini:\uff08\u8def\u5f84\uff1a\/etc\/php5\/apache2\/php.ini\uff09<br \/>\n\u8fd0\u884c\u547d\u4ee4\uff1asudo gedit \/etc\/php5\/apache2\/php.ini\u53ef\u7f16\u8f91\u3002 <\/p>\n<p>\u6b64\u65f6\u8fd9\u4e09\u4e2a\u6587\u4ef6\u6682\u65f6\u4e0d\u7528\u7f16\u8f91\uff0c\u5982\u4e3a\u4e86\u5b89\u5168\u8d77\u89c1\u548c\u4f18\u5316\uff0c\u662f\u4e00\u5b9a\u8981\u7f16\u8f91\u7684\u3002\u5177\u4f53\u7684\u5927\u5bb6\u53ef\u53c2\u89c2\u5176\u5b83\u8d44\u6599\uff0c\u6b64\u7bc7\u6682\u4e0d\u591a\u8bf4\uff01\uff01 <\/p>\n<p>4 . \u5b89\u88c5phpmyadmin<br \/>\nsudo apt-get install phpmyadmin<br \/>\n\u5b89\u88c5\u5b8c\u6bd5\u53ef\u6d4b\u8bd5\uff1ahttp:\/\/127.0.0.1\/phpmyadmin \u5f53\u51fa\u6765\u754c\u9762\u5c31\u884c\u4e86\uff0c\u6682\u65f6\u5148\u522b\u767b\u5f55\uff0c\u7b49\u6539\u4e0b\u4f60\u7684PHPMYADMIN\u7684\u914d\u7f6e\u6587\u4ef6\uff08config.inc.php\uff09\u518d\u767b\u9646\u3002<br \/>\n\u7ec8\u7aef\u8f93\u5165\uff1asudo gedit \/etc\/phpmyadmin\/config.inc.php<br \/>\n\u627e\u5230$cfg[&#8216;Servers&#8217;][$i][&#8216;password&#8217;]= &#8221;;<br \/>\n\u6539\u6210\uff1a$cfg[&#8216;Servers&#8217;][$i][&#8216;password&#8217;]= &#8216;123456&#8217;;<br \/>\n\u2018123456\u2018\u662f\u521a\u624d\u8bbe\u7f6e\u7684mysql\u7684\u5bc6\u7801\u3002 <\/p>\n<p>5 . \u6b64\u65f6\u6700\u597d\u91cd\u65b0\u542f\u52a8\u8ba1\u7b97\u673a,\uff08\u5728\u7f51\u770b\u5230\u6709\u4eba\u8fd9\u6837\u8bf4\uff0c\u56e0\u662f\u7b2c\u4e8c\u6b21\u5b89\u88c5\u4e5f\u5c31\u7167\u505a\u4e86\uff09\u6253\u5f00\u6d4f\u89c8\u5668http:\/\/localhost\/phpmyadmin\/<br \/>\n\u7528\u6237\u540d\u8f93\u5165root,\u518d\u8f93\u5165\u521a\u6539\u7684\u5bc6\u7801\uff0c\u7136\u540e\u6267\u884c<br \/>\n\u53ef\u4ee5\u770b\u5230\u5728win\u4e0b\u90a3\u53ef\u4eb2\u7684phpmyadmin\u9762\u8c8c\u4e86\u3002 <\/p>\n<p>\u5c0f\u7ed3\uff1a<br \/>\napache2\u7684\u64cd\u4f5c\u547d\u4ee4\uff1a<br \/>\n\u542f\u52a8\uff1asudo \/etc\/init.d\/apache2 start<br \/>\n\u91cd\u542f\uff1asudo \/etc\/init.d\/apache2 restart<br \/>\n\u5173\u95ed\uff1asudo \/etc\/init.d\/apache2 stop<br \/>\napache2\u7684\u9ed8\u8ba4\u4e3b\u76ee\u5f55\uff1a\/var\/www\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7528apt-get\u65b9\u6cd5\u5b89\u88c5mysql5 + Apache2 + PHP5\uff0bPhpmyadmin\uff1a \u5927\u5bb6\u8bf7\u5148\u770b\u4e0bU [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[417,415,416,419,418,412],"class_list":["post-1586","post","type-post","status-publish","format-standard","hentry","category-fromnetwork","tag-apache2","tag-apt-get","tag-mysql5","tag-pgpmyadmin","tag-php5","tag-ubuntu"],"views":550,"_links":{"self":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/1586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1586"}],"version-history":[{"count":1,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/1586\/revisions"}],"predecessor-version":[{"id":1587,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/1586\/revisions\/1587"}],"wp:attachment":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1586"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}