{"componentChunkName":"component---src-templates-blog-post-js","path":"/2020/08/08/debian10-安装mysql/","result":{"data":{"site":{"siteMetadata":{"title":"CHENHUOJUN BLOG"}},"post":{"id":"3ed6318a-4776-5bce-a061-7b59e14ad88e","html":"<p>最佳方式，在 <em><a href=\"https://dev.mysql.com/downloads/\">这里下载</a></em> MySQL Community Server 然后选择Debian时会出现建议使用 Mysql APT Repository 的安装方式。所以我们下载Mysql APT Repository，然后更新 APT Repository ，之后使用 apt-get 自动安装。这是最标准的安装方式。下面是具体步骤：</p>\n<ul>\n<li>下载安装 Mysql APT Repository,然后执行下面语句：</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-text line-numbers\"><code class=\"language-text\">sudo apt-get install ./Downloads/mysql-apt-config_0.8.14-1_all.deb</code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span></span></pre></div>\n<blockquote>\n<p>会弹出一个界面，全部默认安装直接选择ok就可以了。</p>\n</blockquote>\n<ul>\n<li>sudo apt-get update 可以看见已经有了mysql</li>\n<li>现在安装 mysql-server</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-text line-numbers\"><code class=\"language-text\">  sudo  apt-get install mysql-server</code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span></span></pre></div>\n<blockquote>\n<p>会弹出一个界面，设置root密码，安全验证选项选择推荐的强验证方式，完成确认即可。</p>\n</blockquote>\n<ul>\n<li>然后就可以进去mysql了</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-text line-numbers\"><code class=\"language-text\">mysql -u root -p</code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span></span></pre></div>\n<ul>\n<li>最后，进行一些安全设置</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-text line-numbers\"><code class=\"language-text\">mysql_secure_installation</code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span></span></pre></div>\n<blockquote>\n<p>基本选择n就可以了，我习惯删除预设的test帐号和数据库。</p>\n</blockquote>\n<ul>\n<li>安装和设置完毕，最后来看一眼安装了啥</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-text line-numbers\"><code class=\"language-text\">apt list --installed | grep mysql</code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span></span></pre></div>\n<blockquote>\n<p>会列出一个安装的list</p>\n</blockquote>\n<ul>\n<li>完成</li>\n</ul>","excerpt":"最佳方式，在 这里下载 MySQL Community Server 然后选择Debian时会出现建议使用 Mysql APT Repository 的安装方式。所以我们下载Mysql APT Repository，然后更新 APT Repository ，之后使用 apt-get 自动安装。这是最标准的安装方式。下面是具体步骤： 下载安装 Mysql APT Repository…","tableOfContents":"","fields":{"slug":"/2020/08/08/debian10-安装mysql/"},"frontmatter":{"date":"August 08, 2020","title":"Debian10 安装mysql","description":"Debian10使用了MariaDB 在APT的软件包存储库中并没有mysql。","quote":{"content":"Without music, life is a journey through a desert.","author":"","source":""},"tags":["Debian","MySQL"]}}},"pageContext":{"id":"3ed6318a-4776-5bce-a061-7b59e14ad88e","prev":{"title":"Ubuntu18.04 sudo apt update无法解析域名的解决方案","path":"/2020/08/02/ubuntu18-04-sudo-apt-update无法解析域名的解决方案/"},"next":{"title":"Debian10 buster 安装 mysql workbench","path":"/2020/08/08/debian10-buster-安装-mysql-workbench/"}}}}