{"id":163,"date":"2018-07-27T09:59:01","date_gmt":"2018-07-27T01:59:01","guid":{"rendered":"http:\/\/shanlin.info\/?p=163"},"modified":"2018-07-27T22:11:29","modified_gmt":"2018-07-27T14:11:29","slug":"python%e6%90%ad%e5%bb%ba%e6%9c%ac%e5%9c%b0%e7%88%ac%e8%99%ab%e6%95%b0%e6%8d%ae%e5%ba%93%e4%b9%8b-mysql8%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/shanlin.info\/?p=163","title":{"rendered":"Python\u642d\u5efa\u672c\u5730\u722c\u866b\u6570\u636e\u5e93\u4e4b-mysql8\u5b89\u88c5"},"content":{"rendered":"<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 10pt;\">1\u3001\u53bb\uff1a<a href=\"https:\/\/dev.mysql.com\/downloads\/file\/?id=476233\"><span style=\"color: blue; text-decoration: underline;\">https:\/\/dev.mysql.com\/downloads\/file\/?id=476233<\/span><\/a>\u4e0b\u8f7dmysql8<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 10pt;\">2\u3001\u89e3\u538b\u540e\u7136\u540e\u5c06<span style=\"color: black; background-color: white;\">mysql-8.0.11-winx64<\/span>\u91cd\u547d\u540d\u4e3amysql8\uff0c\u5e76\u5c06\u89e3\u538b\u540e\u7684\u6587\u4ef6\u653e\u5230D:\\Program Files<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 10pt;\">3\u3001\u5728\u6211\u7684\u7535\u8111\u2014\u2014\u5c5e\u6027\u2014\u2014\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u2014\u2014\u73af\u5883\u53d8\u91cf\u4e2d\u6dfb\u52a0\u8def\u5f84\uff1aD:\\Program Files\\mysql8\\bin<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 10pt;\">4\u3001\u5728mysql\u6839\u76ee\u5f55\u4e0b\u65b0\u5efamy.ini\u521d\u59cb\u5316\u6587\u4ef6\uff0c\u7c98\u8d34\u4ee5\u4e0b\u4ee3\u7801\u4fdd\u5b58\u3002<br \/>\n<\/span><\/p>\n<ol>\n<li>\n<div style=\"background: white;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">[mysqld]\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">#\u00a0\u8bbe\u7f6e3306\u7aef\u53e3\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">port=3306\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">#\u00a0\u8bbe\u7f6emysql\u7684\u5b89\u88c5\u76ee\u5f55\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">basedir=D:\\\\Program\u00a0Files\\\\mysql8\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">#\u00a0\u8bbe\u7f6emysql\u6570\u636e\u5e93\u7684\u6570\u636e\u7684\u5b58\u653e\u76ee\u5f55\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">datadir=D:\\\\Program\u00a0Files\\\\mysql8\\\\Data\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">#\u00a0\u5141\u8bb8\u6700\u5927\u8fde\u63a5\u6570\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">max_connections=200\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">#\u00a0\u5141\u8bb8\u8fde\u63a5\u5931\u8d25\u7684\u6b21\u6570\u3002\u8fd9\u662f\u4e3a\u4e86\u9632\u6b62\u6709\u4eba\u4ece\u8be5\u4e3b\u673a\u8bd5\u56fe\u653b\u51fb\u6570\u636e\u5e93\u7cfb\u7edf\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">max_connect_errors=10\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">#\u00a0\u670d\u52a1\u7aef\u4f7f\u7528\u7684\u5b57\u7b26\u96c6\u9ed8\u8ba4\u4e3aUTF8\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: #006699; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\"><strong>character<\/strong><span style=\"color: black;\"><strong>&#8211;<\/strong><span style=\"color: #006699;\"><strong>set-<\/strong><span style=\"color: black;\">server=utf8\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/span><\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">#\u00a0\u521b\u5efa\u65b0\u8868\u65f6\u5c06\u4f7f\u7528\u7684\u9ed8\u8ba4\u5b58\u50a8\u5f15\u64ce\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: #006699; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\"><strong>default<\/strong><span style=\"color: black;\">-storage-engine=INNODB\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">#\u00a0\u9ed8\u8ba4\u4f7f\u7528&#8221;mysql_native_password&#8221;\u63d2\u4ef6\u8ba4\u8bc1\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">default_authentication_plugin=mysql_native_password\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">[mysql]\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">#\u00a0\u8bbe\u7f6emysql\u5ba2\u6237\u7aef\u9ed8\u8ba4\u5b57\u7b26\u96c6\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: #006699; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\"><strong>default<\/strong><span style=\"color: black;\"><strong>&#8211;<\/strong><span style=\"color: #006699;\"><strong>character<\/strong><span style=\"color: black;\">&#8211;<span style=\"color: #006699;\"><strong>set<\/strong><span style=\"color: black;\">=utf8\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">[client]\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">#\u00a0\u8bbe\u7f6emysql\u5ba2\u6237\u7aef\u8fde\u63a5\u670d\u52a1\u7aef\u65f6\u9ed8\u8ba4\u4f7f\u7528\u7684\u7aef\u53e3\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: white;\"><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\">port=3306\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/div>\n<\/li>\n<li>\n<div style=\"background: #f8f8f8;\"><span style=\"color: #006699; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 9pt;\"><strong>default<\/strong><span style=\"color: black;\">&#8211;<span style=\"color: #006699;\"><strong>character<\/strong><span style=\"color: black;\"><strong>&#8211;<\/strong><span style=\"color: #006699;\"><strong>set<\/strong><span style=\"color: black;\">=utf8\u00a0\u00a0<span style=\"color: #5c5c5c;\"><br \/>\n<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/div>\n<\/li>\n<\/ol>\n<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 10pt;\">5\u3001\u4ee5\u7ba1\u7406\u5458\u8eab\u4efd\u8fd0\u884ccmd\uff0ccd\u8fdb\u5165D:\\Program Files\\mysql8\\bin<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1;\"><span style=\"font-size: 10pt;\">6\u3001\u6267\u884c\u521d\u59cb\u5316\u547d\u4ee4\uff1a <\/span><span style=\"color: black; font-size: 11pt; background-color: white;\"><strong>mysqld &#8211;initialize \u2013console \u8fd9\u91cc\u6ce8\u610f\u4fdd\u5b58\u56fe\u7247\u4e2d\u9ad8\u4eae\u7684\u90e8\u5206\uff0c\u540e\u9762\u767b\u9646\u9700\u8981\u4f7f\u7528\u8be5\u5bc6\u7801\uff0c\u5982\u679c\u4e0d\u5c0f\u5fc3\u5173\u95ed\u4e86\u7a97\u53e3\uff0c\u5220\u6389\u521d\u59cb\u5316\u7684 datadir \u76ee\u5f55\uff0c\u518d\u6267\u884c\u4e00\u904d\u521d\u59cb\u5316\u547d\u4ee4\uff0c\u53c8\u4f1a\u91cd\u65b0\u751f\u6210\u3002<br \/>\n<\/strong><\/span><\/span><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/shanlin.info\/wp-content\/uploads\/2018\/07\/072718_0159_Python1.png\" alt=\"\" \/><span style=\"color: black; font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 11pt; background-color: white;\"><strong><br \/>\n<\/strong><\/span><\/p>\n<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1;\"><span style=\"font-size: 10pt;\">7\u3001\u5b89\u88c5mysql\u670d\u52a1\u3002\u5728cmd\u7a97\u53e3\u6267\u884c\uff1a<\/span><span style=\"color: black; font-size: 11pt; background-color: white;\"><strong>mysqld &#8211;install [\u670d\u52a1\u540d]<\/strong><\/span><span style=\"font-size: 10pt;\">\uff0c\u670d\u52a1\u540d\u79f0\u53ef\u4e0d\u586b\uff0c\u5982\u679c\u5b89\u88c5\u4e86\u591a\u4e2a\u7248\u672c\u7684mysql\u5219\u53ef\u4ee5\u5c06\u670d\u52a1\u540d\u79f0\u586b\u5199\u4e3a\u533a\u522b\u539f\u6765\u7684\u5373\u53ef\u3002<br \/>\n<\/span><\/span><\/p>\n<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1;\"><span style=\"font-size: 10pt;\">8\u3001\u542f\u52a8mysql\u670d\u52a1\uff1a<\/span><span style=\"color: black; font-size: 11pt; background-color: white;\"><strong> net start mysql<\/strong><\/span><span style=\"font-size: 10pt;\"><br \/>\n<\/span><\/span><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/shanlin.info\/wp-content\/uploads\/2018\/07\/072718_0159_Python2.png\" alt=\"\" \/><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 10pt;\"><br \/>\n<\/span><\/p>\n<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1;\"><span style=\"font-size: 10pt;\">9\u3001\u4fee\u6539\u5bc6\u7801\uff1a<\/span><span style=\"color: black; font-size: 11pt; background-color: white;\"><strong> mysql -u root -p <\/strong><\/span><span style=\"font-size: 10pt;\">\u8f93\u5165\u5bc6\u7801\u767b\u9646\uff0c\u7136\u540e\u6267\u884c \uff1a<\/span><\/span><\/p>\n<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1;\"><span style=\"color: black; font-size: 11pt; background-color: white;\"><strong>ALTER USER &#8216;root&#8217;@&#8217;localhost&#8217; IDENTIFIED WITH mysql_native_password BY &#8216;\u65b0\u5bc6\u7801&#8217;;\u00a0<\/strong><\/span><span style=\"font-size: 10pt;\"><br \/>\n<\/span><\/span><\/p>\n<p><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1;\"><span style=\"font-size: 10pt;\">10\u3001\u521b\u5efa\u6570\u636e\u4ee5\u5907\u7528\uff1a<\/span><span style=\"color: black; font-size: 11pt; background-color: white;\"><strong>create database spyder_data;<\/strong><\/span><span style=\"font-size: 10pt;\"><br \/>\n<\/span><\/span><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/shanlin.info\/wp-content\/uploads\/2018\/07\/072718_0159_Python3.png\" alt=\"\" \/><span style=\"font-family: \u5fae\u8f6f\u96c5\u9ed1; font-size: 10pt;\"><br \/>\n<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u53bb\uff1ahttps:\/\/dev.mysql.com\/downloads\/file\/?id=476233\u4e0b\u8f7dmy<\/p><\/div>\n<div class=\"blog-btn\"><a href=\"https:\/\/shanlin.info\/?p=163\" class=\"home-blog-btn\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/shanlin.info\/index.php?rest_route=\/wp\/v2\/posts\/163"}],"collection":[{"href":"https:\/\/shanlin.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shanlin.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shanlin.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shanlin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=163"}],"version-history":[{"count":3,"href":"https:\/\/shanlin.info\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions"}],"predecessor-version":[{"id":167,"href":"https:\/\/shanlin.info\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions\/167"}],"wp:attachment":[{"href":"https:\/\/shanlin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shanlin.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shanlin.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}