{"id":897,"date":"2017-10-14T23:31:49","date_gmt":"2017-10-14T15:31:49","guid":{"rendered":"http:\/\/192.168.1.20\/?p=897"},"modified":"2017-10-16T15:32:07","modified_gmt":"2017-10-16T07:32:07","slug":"{d4daabd1ba368d9860c36387ddb72bbda14f8f9559d69d60a952800885260c03}e6{d4daabd1ba368d9860c36387ddb72bbda14f8f9559d69d60a952800885260c03}90{47dd41ec6bdcbd9a214c783a3735392b82ea6d1d918378c5a53e0640702d813","status":"publish","type":"post","link":"http:\/\/alextop.top\/?p=897","title":{"rendered":"\u642c\u74e6\u5de5ubuntu 14.04 x86\u73af\u5883\u914d\u7f6e\uff08mysql5.5\uff09"},"content":{"rendered":"<h1>1.ubuntu\u4e0b\u5b89\u88c5<a class=\"keylink\" href=\"https:\/\/www.2cto.com\/database\/MySQL\/\" target=\"_blank\" rel=\"noopener\">mysql<\/a>\u9700\u8981\u4e00\u4e9b\u547d\u4ee4<\/h1>\n<h2>(1)sudo apt-get install mysql-server<\/h2>\n<h2>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u4f1a\u51fa\u73b0\u5982\u4e0b\u7a97\u53e3\uff0c\u9700\u8981\u7528\u6237\u8f93\u5165\u76f8\u5173\u7684<a class=\"keylink\" href=\"https:\/\/www.2cto.com\/database\/\" target=\"_blank\" rel=\"noopener\">\u6570\u636e\u5e93<\/a>\u5bc6\u7801\uff1a<img decoding=\"async\" src=\"http:\/\/img.2cto.com\/Collfiles\/20150826\/2015082609525560.png\" alt=\"\\\" \/><\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.2cto.com\/uploadfile\/Collfiles\/20150826\/2015082609525661.png\" alt=\"\\\" \/><\/p>\n<h2>\uff082\uff09sudo apt-get isntall mysql-client<br \/>\n\uff083\uff09sudo apt-get install libmysqlclient-dev<\/h2>\n<h2>\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0c\u53ef\u4ee5\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u68c0\u67e5\u662f\u5426\u5b89\u88c5\u6210\u529f<\/h2>\n<h2><strong>sudo netstat -tap | grep mysql<\/strong><\/h2>\n<p>&nbsp;<\/p>\n<h2>\u901a\u8fc7\u4e0a\u8ff0\u547d\u4ee4\u68c0\u67e5\u4e4b\u540e\uff0c\u5982\u679c\u770b\u5230\u6709mysql \u7684socket\u5904\u4e8e listen \u72b6\u6001\u5219\u8868\u793a\u5b89\u88c5\u6210\u529f\u3002<\/h2>\n<h2><\/h2>\n<div>\n<div id=\"highlighter_535992\" class=\"syntaxhighlighter sql\">\n<div class=\"toolbar\"><a class=\"toolbar_item command_help help\" href=\"https:\/\/www.2cto.com\/database\/201508\/437066.html#\">?<\/a><\/div>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"sql plain\">tcp\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0\u00a0 0 localhost:mysql\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 *:*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 LISTEN\u00a0\u00a0\u00a0\u00a0\u00a0 28385\/mysqld<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h1>2.\u767b\u9646mysql\u53ef\u4ee5\u8f93\u5165\u5982\u4e0b\u547d\u4ee4\uff1a<\/h1>\n<h2>mysql -u root -p<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.2cto.com\/uploadfile\/Collfiles\/20150826\/2015082609525666.png\" alt=\"\\\" \/><\/p>\n<h2>show databases;<\/h2>\n<h2>show tables;<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.2cto.com\/uploadfile\/Collfiles\/20150826\/2015082609525669.png\" alt=\"\\\" \/><\/p>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<p>&nbsp;<\/p>\n<h2><\/h2>\n<p>\u5220\u9664\u533f\u540d\u7528\u6237<\/p>\n<p><code>mysql -uroot -p123456<\/code><\/p>\n<p><code>use mysql;<\/code><\/p>\n<p><code>delete from user where user='';<\/code><br \/>\n\u8bbe\u7f6e\u8fdc\u7a0b\u8bbf\u95ee<\/p>\n<p><code>nano \/etc\/mysql\/my.cnf<\/code>\u627e\u5230<code>bind-address = 127.0.0.1<\/code>\uff0c\u6ce8\u91ca\u6389<\/p>\n<p>\u6709\u7684\u662f\u5728<code>\/etc\/mysql\/mysql.conf.d<\/code><\/p>\n<p>\u5982\u679c\u4f60\u7684\u7535\u8111\u4e0a\u4e5f\u5f00\u4e86mysql\u7684\u8bdd\u7aef\u53e3\u4f1a\u51b2\u7a81\u628a\u670d\u52a1\u5668\u4e0a\u7aef\u53e3\u7684\u6539\u62103307\u5c31\u597d\u00a0 \u6709\u7528\u7684 \u4eb2\u6d4b<br \/>\n\u589e\u52a0\u5141\u8bb8\u8fdc\u7a0b\u8bbf\u95ee\u7684\u7528\u6237\u6216\u8005\u5141\u8bb8\u73b0\u6709\u7528\u6237\u7684\u8fdc\u7a0b\u8bbf\u95ee\u3002<br \/>\n<code>mysql&gt;grant all on *.* to root@'{d4daabd1ba368d9860c36387ddb72bbda14f8f9559d69d60a952800885260c03}' identified by 'password' with grant option;<\/code><\/p>\n<p><code>mysql&gt;flush privileges;<\/code>(\u5237\u65b0user\u8868\u6743\u9650\uff0c\u5426\u5219\u4f1a\u51fa\u73b0\u62d2\u7edd\u8bbf\u95ee)<\/p>\n<p><code>mysql&gt;exit<\/code><\/p>\n<p><code>service mysql restart<\/code><\/p>\n<p>ubuntu\u4e0b\u67e5\u770bmysql\u7248\u672c<\/p>\n<p><code>mysql -V<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.ubuntu\u4e0b\u5b89\u88c5mysq&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-897","post","type-post","status-publish","format-standard","hentry","category-jishu"],"_links":{"self":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts\/897"}],"collection":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=897"}],"version-history":[{"count":0,"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts\/897\/revisions"}],"wp:attachment":[{"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=897"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}