Arm架构下麒麟操作系统安装配置Mariadb数据库
<h2 style="text-align: left" align="center">1、<strong><span style="font-family: 宋体">安装配置</span><span style="font-family: 宋体">JDK</span></strong></h2><p>(1)检查机器是否已安装JDK</p>
<p><span style="font-family: 仿宋">执行</span> <span style="font-family: 仿宋">java -version命令查看机器是否安装JDK,一般麒麟操作系统默认安装openjdk 1.8。</span> </p>
<p><img src="https://img2024.cnblogs.com/blog/624219/202404/624219-20240406132227366-2059687887.png"></p>
<p>(2)<span style="font-family: 仿宋">安装指定版本</span><span style="font-family: 仿宋">JDK</span></p>
<p>如果麒麟操作系统默认安装的openjdk 1.8不符合需求的话,可以卸载机器安装的openjdk 1.8并按需安装所需的openjdk版本,此步骤本文不再赘余。</p>
<h2>2、<strong>安装配置</strong><strong><span style="font-family: Calibri">mariadb</span></strong></h2>
<p>(1)<span style="font-family: 仿宋">检查机器</span><span style="font-family: 仿宋">mariadb rpm包</span></p>
<p><span style="font-family: 仿宋">麒麟操作系统默认都自带mariadb,可以通过</span><span style="font-family: 仿宋">执行</span> <span style="font-family: 仿宋">rpm -qa|grep mariadb命令查看机器是否安装</span>mariadb,如果有类似返回值表示机器已安装mariadb,如果机器mariadb包版本不符合需求的话需要卸载机器mariadb并自行下载指定版本的mariadb rpm包。 </p>
<p><img src="https://img2024.cnblogs.com/blog/624219/202404/624219-20240406134134451-381221711.png"></p>
<p>(2)<span style="font-family: 仿宋">启动</span><span style="font-family: 仿宋">mariadb并配置开启自启</span></p>
<div class="cnblogs_Highlighter">
<pre class="brush:html;gutter:true;">systemctl start mariadb
systemctl enable mariadb</pre>
</div>
<p>(3)检查服务状态</p>
<div class="cnblogs_Highlighter">
<pre class="brush:html;gutter:true;">systemctl status mariadb </pre>
</div>
<p><img src="https://img2024.cnblogs.com/blog/624219/202404/624219-20240406142518353-1247159933.png"></p>
<p>(4)登陆到数据库配置密码</p>
<p><span style="font-family: 仿宋">用</span><span style="font-family: 仿宋">mysql -u root -p命令登录到MariaDB,此时root账户的密码为空。</span></p>
<div class="cnblogs_Highlighter">
<pre class="brush:html;gutter:true;">第一步:改变用户数据库
mysql> use mysql
第二步:修改密码,记得密码要用password()函数进行加密,一定不要忘记!!! 红色是想要配置密码一定按需配置!!!
mysql> update user set password=password('qwe123') where user='root';
第三步:刷新权限表
mysql> flush privileges;
第四步:退出
mysql> exit</pre>
</div>
<p>(5)修改服务端配置</p>
<p><span style="font-family: 仿宋">修改前先备份</span><span style="font-family: 仿宋">mariadb服务端配置文件 。</span></p>
<div class="cnblogs_Highlighter">
<pre class="brush:html;gutter:true;">cd /etc
tar -zcvf mysql0403.tar.gz my.cnf.d</pre>
</div>
<p>修改服务端配置,在配置下追加以下内容,并新增配置。</p>
<div class="cnblogs_Highlighter">
<pre class="brush:html;gutter:true;">vi /etc/my.cnf.d/mariadb-server.cnf
symbolic-links=0
character-set-server=utf8
key_buffer_size = 384M
max_allowed_packet = 10M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M
skip_ssl
group_concat_max_len=300000
max_heap_table_size = 256M
max_connections=4000
lower_case_table_names=1
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M</pre>
</div>
<p>(6)<span style="font-family: 仿宋">重新启动</span><span style="font-family: 仿宋">mariadb使配置生效</span></p>
<div class="cnblogs_Highlighter">
<pre class="brush:html;gutter:true;">systemctl restart mariadb</pre>
</div>
<p>检查服务状态。</p>
<div class="cnblogs_Highlighter">
<pre class="brush:html;gutter:true;">systemctl status mariadb
</pre>
</div>
<p><span style="font-size: 2em"><span style="font-size: 14px">(7)登陆到数据库</span><br></span></p>
<p><span style="font-family: 仿宋">用</span><span style="font-family: 仿宋">mysql -u root -p命令登录到MariaDB,输入密码代表整个数据库安装配置成功。</span></p><br><br>
来源:https://www.cnblogs.com/zhangmingcheng/p/18117412
頁:
[1]