<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>凉凉深秋</title><link>http://myz.donghy.cn/</link><description>Good Luck To You!</description><item><title>php无法连接mysql8 mysql_native_password</title><link>http://myz.donghy.cn/?id=5</link><description>&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;1. 下载Mysql的Docker镜像：&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;ol style=&quot;box-sizing: border-box; margin-bottom: 20px; margin-left: 50px; padding: 0px; list-style-position: initial; list-style-image: initial; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot; class=&quot; list-paddingleft-2&quot;&gt;&lt;li&gt;&lt;p&gt;$&amp;nbsp;docker&amp;nbsp;search&amp;nbsp;mysql&amp;nbsp;(搜索mysql镜像)&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;$&amp;nbsp;docker&amp;nbsp;pull&amp;nbsp;mysql&amp;nbsp;（下载mysql镜像，默认最新版本）&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;br style=&quot;box-sizing: border-box;&quot;/&gt;2. 运行镜像，设置root账号初始密码（123456），映射本地宿主机端口3306到Docker端口3306。测试过程没有挂载本地数据盘：&lt;/p&gt;&lt;p class=&quot;alt&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;docker&amp;nbsp;run&amp;nbsp;-it&amp;nbsp;–rm&amp;nbsp;–name mysql&amp;nbsp;-e&amp;nbsp;MYSQL_ROOT_PASSWORD=123456&amp;nbsp;-p&amp;nbsp;3306:3306&amp;nbsp;-d&amp;nbsp;mysql&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;alt&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;3. 查看已运行的容器：&lt;/p&gt;&lt;p class=&quot;alt&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;docker&amp;nbsp;ps&amp;nbsp;-a&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;alt&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;4. 进入mysql容器：&lt;/p&gt;&lt;p class=&quot;alt&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;docker&amp;nbsp;exec&amp;nbsp;-it mysql&amp;nbsp;bash&amp;nbsp;&lt;/p&gt;&lt;p class=&quot;alt&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;5. 在容器内登陆Mysql:&lt;/p&gt;&lt;p class=&quot;alt&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;mysql&amp;nbsp;-uroot&amp;nbsp;-p123456&lt;/p&gt;&lt;p class=&quot;alt&quot; style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;img src=&quot;https://img2018.cnblogs.com/blog/934198/201811/934198-20181107182542616-1446436274.png&quot; alt=&quot;&quot; data-tag=&quot;bdshare&quot; style=&quot;box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; margin: 5px 0px; display: block; height: auto;&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;6. 查看用户信息&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;select&amp;nbsp;host,user,plugin,authentication_string&amp;nbsp;from&amp;nbsp;mysql.user;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;备注：host为 % 表示不限制ip &amp;nbsp; localhost表示本机使用 &amp;nbsp; &amp;nbsp;plugin非mysql_native_password 则需要修改密码&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;ALTER&amp;nbsp;&lt;span class=&quot;func&quot; style=&quot;box-sizing: border-box;&quot;&gt;user&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;‘root’@&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;‘%’&amp;nbsp;IDENTIFIED&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;WITH&amp;nbsp;mysql_native_password&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;BY&amp;nbsp;&lt;span class=&quot;string&quot; style=&quot;box-sizing: border-box;&quot;&gt;‘123456’;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;FLUSH&amp;nbsp;&lt;span class=&quot;keyword&quot; style=&quot;box-sizing: border-box;&quot;&gt;PRIVILEGES;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&lt;img src=&quot;https://img2018.cnblogs.com/blog/934198/201811/934198-20181107182733786-72383235.png&quot; alt=&quot;&quot; data-tag=&quot;bdshare&quot; style=&quot;box-sizing: border-box; border: 0px; vertical-align: middle; max-width: 100%; margin: 5px 0px; display: block; height: auto;&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;mysql&amp;gt; exit;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;&amp;nbsp;ctrl+d 退出容器且关闭, docker ps 查看无&lt;/p&gt;&lt;p style=&quot;box-sizing: border-box; margin-top: 0px; margin-bottom: 20px; overflow-wrap: break-word; color: rgb(51, 51, 51); font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; background-color: rgb(255, 255, 255);&quot;&gt;ctrl+p+q 退出容器但不关闭, docker ps 查看有&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sun, 28 Nov 2021 10:43:28 +0800</pubDate></item><item><title>你好欢迎来到我的小家</title><link>http://myz.donghy.cn/?id=4</link><description>&lt;p&gt;你好欢迎来到我的小家&lt;/p&gt;</description><pubDate>Fri, 26 Nov 2021 18:37:13 +0800</pubDate></item></channel></rss>