<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MySQL &#8211; 编程小札 &#8211; CodeShell.io</title>
	<atom:link href="https://codeshell.io/archives/category/mysql/feed" rel="self" type="application/rss+xml" />
	<link>https://codeshell.io</link>
	<description></description>
	<lastBuildDate>Fri, 15 Aug 2025 19:42:08 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>

<image>
	<url>https://codeshell.io/wp-content/uploads/2020/06/cropped-code-32x32.png</url>
	<title>MySQL &#8211; 编程小札 &#8211; CodeShell.io</title>
	<link>https://codeshell.io</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ubuntu22.04 安装 MySQL 5.7</title>
		<link>https://codeshell.io/archives/563</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 01 Feb 2024 15:17:21 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<guid isPermaLink="false">https://codeshell.io/?p=563</guid>

					<description><![CDATA[1 . 添加 MySQL 源 添加如下内容 更新 执行过程中可能会出现如下错误 执行如下命令即可，B7B3B788A8D3785C 根据实际情况替换 接着再重新...<p class="read-more"><a class="btn btn-default" href="https://codeshell.io/archives/563"> Read More<span class="screen-reader-text">  Read More</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p class="has-medium-font-size">1 . 添加 MySQL 源</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="" style="font-size:clamp(14px, .875rem, 21px);line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="复制" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo vim /etc/apt/sources.list.d/mysql.list</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">sudo</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">vim</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">/etc/apt/sources.list.d/mysql.list</span></span></code></pre></div>



<p></p>



<p class="has-small-font-size">添加如下内容</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="" style="font-size:clamp(14px, .875rem, 21px);line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="复制" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-apt-config
deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7
deb http://repo.mysql.com/apt/ubuntu/ bionic mysql-tools
deb-src http://repo.mysql.com/apt/ubuntu/ bionic mysql-5.7</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">deb</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">http://repo.mysql.com/apt/ubuntu/</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">bionic</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">mysql-apt-config</span></span>
<span class="line"><span style="color: #88C0D0">deb</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">http://repo.mysql.com/apt/ubuntu/</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">bionic</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">mysql-5.7</span></span>
<span class="line"><span style="color: #88C0D0">deb</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">http://repo.mysql.com/apt/ubuntu/</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">bionic</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">mysql-tools</span></span>
<span class="line"><span style="color: #88C0D0">deb-src</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">http://repo.mysql.com/apt/ubuntu/</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">bionic</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">mysql-5.7</span></span></code></pre></div>



<p></p>



<p class="has-small-font-size">更新</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="" style="font-size:clamp(14px, .875rem, 21px);line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="复制" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo apt update</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">sudo</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">apt</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">update</span></span></code></pre></div>



<p></p>



<p class="has-small-font-size">执行过程中可能会出现如下错误</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="" style="font-size:clamp(14px, .875rem, 21px);line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="复制" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>Err:5 http://repo.mysql.com/apt/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
Reading package lists... Done
W: GPG error: http://repo.mysql.com/apt/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
E: The repository 'http://repo.mysql.com/apt/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">Err:5</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">http://repo.mysql.com/apt/ubuntu</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">bionic</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">InRelease</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #88C0D0">The</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">following</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">signatures</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">couldn</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">t be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C</span></span>
<span class="line"><span style="color: #A3BE8C">Reading package lists... Done</span></span>
<span class="line"><span style="color: #A3BE8C">W: GPG error: http://repo.mysql.com/apt/ubuntu bionic InRelease: The following signatures couldn</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">t</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">be</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">verified</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">because</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">the</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">key</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">is</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">not</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">available:</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">NO_PUBKEY</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">B7B3B788A8D3785C</span></span>
<span class="line"><span style="color: #88C0D0">E:</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">The</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">repository</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">http://repo.mysql.com/apt/ubuntu bionic InRelease</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">is</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">not</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">signed.</span></span>
<span class="line"><span style="color: #88C0D0">N:</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">Updating</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">from</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">such</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">a</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">repository</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">can</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">t be done securely, and is therefore disabled by default.</span></span>
<span class="line"><span style="color: #A3BE8C">N: See apt-secure(8) manpage for repository creation and user configuration details</span></span></code></pre></div>



<p></p>



<p class="has-small-font-size">执行如下命令即可，<code>B7B3B788A8D3785C</code> 根据实际情况替换</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="" style="font-size:clamp(14px, .875rem, 21px);line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="复制" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">sudo</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">apt-key</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">adv</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">--keyserver</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">keyserver.ubuntu.com</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">--recv-keys</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">B7B3B788A8D3785C</span></span></code></pre></div>



<p></p>



<p class="has-small-font-size">接着再重新执行更新</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="" style="font-size:clamp(14px, .875rem, 21px);line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="复制" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo apt update</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">sudo</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">apt</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">update</span></span></code></pre></div>



<p></p>



<p class="has-medium-font-size">2 . 安装 MySQL</p>



<p></p>



<p class="has-small-font-size">查看支持的 MySQL 版本，此处我们已经可以看到有 <code>5.7.42-1ubuntu18.04</code>，接近成功了</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="" style="font-size:clamp(14px, .875rem, 21px);line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="复制" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>mysql-server:
  Installed: (none)
  Candidate: 8.0.36-0ubuntu0.22.04.1
  Version table:
     8.0.36-0ubuntu0.22.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages
     8.0.28-0ubuntu4 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
     5.7.42-1ubuntu18.04 500
        500 http://repo.mysql.com/apt/ubuntu bionic/mysql-5.7 amd64 Packages</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">mysql-server:</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #88C0D0">Installed:</span><span style="color: #D8DEE9FF"> (none)</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #88C0D0">Candidate:</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">8.0</span><span style="color: #A3BE8C">.36-0ubuntu0.22.04.1</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #88C0D0">Version</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">table:</span></span>
<span class="line"><span style="color: #D8DEE9FF">     </span><span style="color: #88C0D0">8.0.36-0ubuntu0.22.04.1</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">500</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #88C0D0">500</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">http://us.archive.ubuntu.com/ubuntu</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">jammy-updates/main</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">amd64</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">Packages</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #88C0D0">500</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">http://us.archive.ubuntu.com/ubuntu</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">jammy-security/main</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">amd64</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">Packages</span></span>
<span class="line"><span style="color: #D8DEE9FF">     </span><span style="color: #88C0D0">8.0.28-0ubuntu4</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">500</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #88C0D0">500</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">http://us.archive.ubuntu.com/ubuntu</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">jammy/main</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">amd64</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">Packages</span></span>
<span class="line"><span style="color: #D8DEE9FF">     </span><span style="color: #88C0D0">5.7.42-1ubuntu18.04</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">500</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #88C0D0">500</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">http://repo.mysql.com/apt/ubuntu</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">bionic/mysql-5.7</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">amd64</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">Packages</span></span></code></pre></div>



<p></p>



<p class="has-small-font-size">安装 MySQL 5.7 版本客户端和服务端，版本信息根据上面的输出自行修改</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="" style="font-size:clamp(14px, .875rem, 21px);line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="复制" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>sudo apt install mysql-client=5.7.42-1ubuntu18.04
sudo apt install mysql-server=5.7.42-1ubuntu18.04</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">sudo</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">apt</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">install</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">mysql-client=</span><span style="color: #B48EAD">5.7</span><span style="color: #A3BE8C">.42-1ubuntu18.04</span></span>
<span class="line"><span style="color: #88C0D0">sudo</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">apt</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">install</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">mysql-server=</span><span style="color: #B48EAD">5.7</span><span style="color: #A3BE8C">.42-1ubuntu18.04</span></span></code></pre></div>



<p></p>



<p class="has-medium-font-size">3 . 验证</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="" style="font-size:clamp(14px, .875rem, 21px);line-height:clamp(20px, 1.25rem, 30px);--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="复制" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>mysql --version</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">mysql</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">--version</span></span></code></pre></div>



<p></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
