【转】【arm64 飞腾】银河麒麟/统信UOS/ubuntu20.0.4系统离线安装mysql
<p>原文:https://blog.csdn.net/weixin_43744523/article/details/124516789</p><h1 id="一安装环境">一、安装环境:</h1>
<pre><code>1、亲测银河麒麟、统信UOS、ubuntu20系统离线安装mysql5.7成功
2、mysql数据库5.7 arm64 deb 安装版
3、mysql下载地址:wget下载失败的可以使用作者分享的网盘下载
链接:https://pan.baidu.com/s/1Pc04w4lLqEoj6PQCJYmjqA?pwd=aob2
提取码:aob2
</code></pre>
<pre><code>wget http://launchpadlibrarian.net/451652941/mysql-server_5.7.28-0ubuntu0.18.04.4_all.deb
wget http://launchpadlibrarian.net/451655612/mysql-server-5.7_5.7.28-0ubuntu0.18.04.4_arm64.deb
wget http://launchpadlibrarian.net/451655610/mysql-client-5.7_5.7.28-0ubuntu0.18.04.4_arm64.deb
wget http://launchpadlibrarian.net/353280751/mysql-common_5.8+1.0.4_all.deb
wget http://launchpadlibrarian.net/451655611/mysql-client-core-5.7_5.7.28-0ubuntu0.18.04.4_arm64.deb
wget http://launchpadlibrarian.net/451655613/mysql-server-core-5.7_5.7.28-0ubuntu0.18.04.4_arm64.deb
wget http://launchpadlibrarian.net/355861262/libevent-core-2.1-6_2.1.8-stable-4build1_arm64.deb
</code></pre>
<h1 id="二开始安装">二、开始安装:</h1>
<p>注意安装时建议使用root账号可以避免一些问题,安装完成后登录报错可以尝试使用root账号登录。</p>
<h2 id="在下载的mysql文件目录中执行安装一般会报错反复执行直到不报错为止">在下载的mysql文件目录中执行安装,一般会报错,反复执行直到不报错为止</h2>
<pre><code>sudo dpkg -i *.deb
</code></pre>
<h2 id="设置mysql自启">设置mysql自启</h2>
<pre><code>sudo systemctl list-units -all --type=service|grep mysql
</code></pre>
<h2 id="启动mysql服务">启动mysql服务</h2>
<pre><code>sudo systemctl start mysql
</code></pre>
<h2 id="登录mysql的root用户密码默认为空">登录mysql的root用户密码默认为空</h2>
<pre><code>mysql -uroot -p
</code></pre>
<h1 id="三修改root密码并设置远程连接">三、修改root密码并设置远程连接:</h1>
<p>由于5.7的mysql数据库已经没有password字段,可以使用以下方式修改root账号密码。</p>
<h2 id="登录mysql">登录mysql</h2>
<pre><code>mysql -uroot -p
</code></pre>
<h2 id="选择mysql库">选择mysql库</h2>
<pre><code>use mysql;
</code></pre>
<h2 id="修改root密码">修改root密码</h2>
<pre><code>update user set authentication_string = password('root') where User ='root';
</code></pre>
<h2 id="添加test用户用于远程连接账号">添加test用户用于远程连接账号</h2>
<pre><code>GRANT ALL PRIVILEGES ON *.* TO 'test'@'%' IDENTIFIED BY 'test' WITH GRANT OPTION;
SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
</code></pre>
<h2 id="设置立即生效">设置立即生效</h2>
<pre><code>flush privileges;
</code></pre>
<h2 id="退出mysql">退出mysql</h2>
<pre><code>exit;
</code></pre>
<h2 id="修改mysql数据库配置文件">修改mysql数据库配置文件</h2>
<pre><code>sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
</code></pre>
<h2 id="使用vim注释掉mysql配置文件中bind-address127001">使用vim注释掉mysql配置文件中bind-address=127.0.0.1</h2>
<h2 id="重启mysql服务">重启mysql服务</h2>
<pre><code>sudo systemctl stop mysql
sudo systemctl start mysql
</code></pre>
<hr>
<p>到此便安装完成了。<br>
————————————————<br>
版权声明:本文为CSDN博主「飞来直去」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。<br>
原文链接:https://blog.csdn.net/weixin_43744523/article/details/124516789</p><br><br>
来源:https://www.cnblogs.com/tc310/p/16923613.html
頁:
[1]