首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >MariaDB源码编译安装(三)

MariaDB源码编译安装(三)

原创
作者头像
Raymond运维
修改2025-09-30 10:56:07
修改2025-09-30 10:56:07
2600
举报
文章被收录于专栏:干货分享干货分享

2.4.5 准备环境变量

代码语言:javascript
复制
1echo'PATH=/apps/mariadb/bin:$PATH'> /etc/profile.d/mariadb.sh
2. /etc/profile.d/mariadb.sh
3
4chown-R mysql:mysql /apps/mariadb/

2.4.6 生成数据库文件

代码语言:javascript
复制
1# 这里必须先要进入/apps/mariadb/目录,在执行下面命令
2cd /apps/mariadb/
3./scripts/mariadb-install-db --datadir=/data/mariadb/ --user=mysql

2.4.7 准备配置文件

代码语言:javascript
复制
1cat> /etc/my.cnf <<EOF
2[mariadb]
3basedir=/apps/mariadb/
4datadir=/data/mariadb
5port=3306
6socket=/data/mariadb/mariadb.sock
7pid-file=/data/mariadb/mariadb.pid
8log-error=/data/mariadb/mariadb.log
9
10[client]
11port=3306
12socket=/data/mariadb/mariadb.sock
13EOF

2.4.8 准备启动脚本并启动服务

代码语言:javascript
复制
1# Rocky、Almalinux、CentOS、openEuler、AnolisOS、OpenCloudOS、 Kylin Server、UOS Server、openSUSE
2cp /apps/mariadb/support-files/systemd/mariadb.service /usr/lib/systemd/system/
3
4# Ubuntu和Debian
5cp /apps/mariadb/support-files/systemd/mariadb.service /lib/systemd/system/
6
7systemctl daemon-reload && systemctl enable--now mariadb

2.4.9 安全初始化

代码语言:javascript
复制
1[root@rocky10 mariadb]# mariadb
2Welcome to the MariaDB monitor.  Commands end with ; or \g.
3Your MariaDB connection id is 4
4Server version: 11.8.3-MariaDB Source distribution
5
6Copyright (c)2000, 2018, Oracle, MariaDB Corporation Ab and others.
7
8Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.
9
10MariaDB [(none)]> status
11--------------
12mariadb from 11.8.3-MariaDB, client 15.2for Linux (x86_64) using readline 5.1
13
14Connection id:		3
15Current database:	
16Current user:		root@localhost
17SSL:			Cipher in use is TLS_AES_256_GCM_SHA384, cert is OK
18Current pager:		stdout
19Using outfile:		''
20Using delimiter:	;
21Server:			MariaDB
22Server version:		11.8.3-MariaDB Source distribution
23Protocol version:	10
24Connection:		Localhost via UNIX socket
25Server characterset:	utf8mb4
26Db     characterset:	utf8mb4
27Client characterset:	utf8mb4
28Conn.  characterset:	utf8mb4
29UNIX socket:		/data/mariadb/mariadb.sock
30Uptime:			9 sec
31
32Threads: 1  Questions: 4  Slow queries: 0  Opens: 17  Open tables: 10  Queries per second avg: 0.444
33--------------
34
35MariaDB [(none)]> show databases;
36+--------------------+
37| Database           |
38+--------------------+
39| information_schema |
40| mysql              |
41| performance_schema |
42| sys                |
43|test|# 有test数据库
44+--------------------+
455 rows inset(0.001 sec)
46
47MariaDB [(none)]>select user,host from mysql.user;
48+-------------+-----------+
49| User        | Host      |
50+-------------+-----------+
51| PUBLIC      ||
52|| localhost |# 有匿名用户 
53| mariadb.sys | localhost |
54| mysql       | localhost |
55| root        | localhost |
56|| rocky10   |# 有远程登陆用户
57+-------------+-----------+
586 rows inset(0.002 sec)
59
60MariaDB [(none)]>exit
61Bye
62
63# 有test数据库、匿名用户和远程登录用户,需要安全初始化
64[root@rocky10 mariadb]# mariadb-secure-installation
65
66NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
67      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
68
69In order to log into MariaDB to secure it, we'll need the current
70password for the root user. If you've just installed MariaDB, and
71haven't set the root password yet, you should just press enter here.
72
73Enter current password for root (enter for none):  # 输入 root 的当前密码(不输入),直接敲回车
74OK, successfully used password, moving on...
75
76Setting the root password or using the unix_socket ensures that nobody
77can log into the MariaDB root user without the proper authorisation.
78
79You already have your root account protected, so you can safely answer 'n'.
80
81Switch to unix_socket authentication [Y/n] y # 输入y,切换到 unix_socket 身份验证
82Enabled successfully!
83Reloading privilege tables..
84... Success!
85
86
87You already have your root account protected, so you can safely answer 'n'.
88
89Change the root password? [Y/n] n # 输入n,不设置root密码
90... skipping.
91
92By default, a MariaDB installation has an anonymous user, allowing anyone
93to log into MariaDB without having to have a user account created for
94them.  This is intended only for testing, and to make the installation
95go a bit smoother.  You should remove them before moving into a
96production environment.
97
98Remove anonymous users? [Y/n] y # 输入y,移除匿名账户
99... Success!
100
101Normally, root should only be allowed to connect from 'localhost'.  This
102ensures that someone cannot guess at the root password from the network.
103
104Disallow root login remotely? [Y/n] y # 输入y,禁止 root 远程登录
105... Success!
106
107By default, MariaDB comes with a database named 'test' that anyone can
108access.  This is also intended only for testing, and should be removed
109before moving into a production environment.
110
111Remove test database and access to it? [Y/n] y # 输入y,移除测试库
112 - Dropping test database...
113... Success!
114 - Removing privileges on test database...
115... Success!
116
117Reloading the privilege tables will ensure that all changes made so far
118will take effect immediately.
119
120Reload privilege tables now? [Y/n] y y # 输入y,重新加载权限表
121... Success!
122
123Cleaning up...
124
125All done!  If you've completed all of the above steps, your MariaDB
126installation should now be secure.
127
128Thanks for using MariaDB!

2.4.10 登录测试

代码语言:javascript
复制
1[root@rocky10 mariadb]# mariadb
2Welcome to the MariaDB monitor.  Commands end with ; or \g.
3Your MariaDB connection id is 13
4Server version: 11.8.3-MariaDB Source distribution
5
6Copyright (c)2000, 2018, Oracle, MariaDB Corporation Ab and others.
7
8Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.
9
10MariaDB [(none)]> status
11--------------
12mariadb from 11.8.3-MariaDB, client 15.2for Linux (x86_64) using readline 5.1
13
14Connection id:		3
15Current database:	
16Current user:		root@localhost
17SSL:			Cipher in use is TLS_AES_256_GCM_SHA384, cert is OK
18Current pager:		stdout
19Using outfile:		''
20Using delimiter:	;
21Server:			MariaDB
22Server version:		11.8.3-MariaDB Source distribution
23Protocol version:	10
24Connection:		Localhost via UNIX socket
25Server characterset:	utf8mb4
26Db     characterset:	utf8mb4
27Client characterset:	utf8mb4
28Conn.  characterset:	utf8mb4
29UNIX socket:		/data/mariadb/mariadb.sock
30Uptime:			9 sec
31
32Threads: 1  Questions: 4  Slow queries: 0  Opens: 17  Open tables: 10  Queries per second avg: 0.444
33--------------
34
35MariaDB [(none)]> show databases;
36+--------------------+
37| Database           |
38+--------------------+
39| information_schema |
40| mysql              |
41| performance_schema |
42| sys                |
43+--------------------+
444 rows inset(0.001 sec)
45# 可以看到已经没有test数据库了
46
47MariaDB [(none)]>select user,host from mysql.user;
48+-------------+-----------+
49| User        | Host      |
50+-------------+-----------+
51| PUBLIC      ||
52| mariadb.sys | localhost |
53| mysql       | localhost |
54| root        | localhost |
55+-------------+-----------+
564 rows inset(0.001 sec)
57# 可以看到已经没有匿名用户和远程登录用户了
58
59MariaDB [(none)]>exit
60Bye

2.4.11 一键安装MariaDB源码编译的脚本

Shell脚本源码地址:

Gitee:https://gitee.com/raymond9/shell

Github:https://github.com/raymond999999/shell

可以去上面的Gitee或Github代码仓库拉取脚本。

代码语言:javascript
复制
1[root@rocky10 ~]# cat install_mariadb_source_v2.sh 
2#!/bin/bash
3#
4#**********************************************************************************
5#Author:        Raymond
6#QQ:            88563128
7#MP:            Raymond运维
8#Date:          2025-09-22
9#FileName:      install_mariadb_source_v3.sh
10#URL:           https://wx.zsxq.com/group/15555885545422
11#Description:   The mariadb source script install supports 
12#               “Rocky Linux 8, 9 and 10, AlmaLinux 8, 9 and 10, CentOS 7, 
13#               CentOS Stream 8, 9 and 10, openEuler 22.03 and 24.03 LTS, 
14#               AnolisOS 8 and 23, OpenCloudOS 8 and 9, Kylin Server v10 and v11, 
15#               UOS Server v20, Ubuntu Server 18.04, 20.04, 22.04 and 24.04 LTS,  
16#               Debian 11 , 12 and 13, openSUSE Leap 15“ operating systems.
17#Copyright (C): 2025 All rights reserved
18#**********************************************************************************
19COLOR="echo -e \\033[01;31m"
20END='\033[0m'
21
22os(){
23. /etc/os-release
24MAIN_NAME=`sed-rn'/^NAME=/s@.*="([[:alpha:]]+).*"$@\1@p' /etc/os-release`
25if[${MAIN_NAME}=="Kylin"];then
26MAIN_VERSION_ID=`sed-rn'/^VERSION_ID=/s@.*="([[:alpha:]]+)(.*)"$@\2@p' /etc/os-release`
27else
28MAIN_VERSION_ID=`sed-rn'/^VERSION_ID=/s@.*="?([0-9]+)\.?.*"?@\1@p' /etc/os-release`
29fi
30if[${MAIN_NAME}=="Ubuntu"-o${MAIN_NAME}=="Debian"];then
31FULL_NAME="${PRETTY_NAME}"
32elif[${MAIN_NAME}=="UOS"];then
33FULL_NAME="${NAME}"
34else
35FULL_NAME="${NAME}${VERSION_ID}"
36fi
37}
38
39os
40SRC_DIR=/usr/local/src
41INSTALL_DIR=/apps/mariadb
42DATA_DIR=/data/mariadb
43
44# mariadb 11.8.3包下载地址:"https://mirrors.tuna.tsinghua.edu.cn/mariadb///mariadb-11.8.3/source/mariadb-11.8.3.tar.gz"
45# fmt 11.1.4包下载地址:"https://gh-proxy.com/https://github.com/fmtlib/fmt/releases/download/11.1.4/fmt-11.1.4.zip"
46
47# mariadb 10.11.14包下载地址:"https://mirrors.tuna.tsinghua.edu.cn/mariadb/mariadb-10.11.14/source/mariadb-10.11.14.tar.gz"
48# fmt 11.0.2包下载地址:"https://gh-proxy.com/https://github.com/fmtlib/fmt/releases/download/11.0.2/fmt-11.0.2.zip"
49
50if[${MAIN_NAME}=="CentOS"-a${MAIN_VERSION_ID}==7];then
51MARIADB_VERSION=10.11.14
52FMT_VERSION=11.0.2
53else
54MARIADB_VERSION=11.8.3
55FMT_VERSION=11.1.4
56fi
57MARIADB_URL="https://mirrors.tuna.tsinghua.edu.cn/mariadb/mariadb-${MARIADB_VERSION}/source/"
58MARIADB_FILE="mariadb-${MARIADB_VERSION}.tar.gz"
59
60FMT_URL="https://gh-proxy.com/https://github.com/fmtlib/fmt/releases/download/${FMT_VERSION}/"
61FMT_FILE="fmt-${FMT_VERSION}.zip"
62
63CMAKE_URL='https://cmake.org/files/v3.31/'
64CMAKE_FILE='cmake-3.31.7-linux-x86_64.tar.gz'
65
66check_mysql_file(){
67if[${MAIN_NAME}=="Rocky"-o${MAIN_NAME}=="AlmaLinux"-o${MAIN_NAME}=="CentOS"-o${MAIN_NAME}=="Anolis"-o${MAIN_NAME}=="OpenCloudOS"-o${MAIN_NAME}=="Kylin"];then
68rpm-qwget&> /dev/null ||{${COLOR}"安装wget工具,请稍等......"${END};yum -yinstallwget&> /dev/null;}
69fi
70if[!-e${MARIADB_FILE}];then
71${COLOR}"缺少${MARIADB_FILE}文件!"${END}
72${COLOR}'开始下载MariaDB源码包......'${END}
73wget${MARIADB_URL}${MARIADB_FILE}||{${COLOR}"MariaDB源码包下载失败!"${END};exit;}
74else
75${COLOR}"${MARIADB_FILE}文件已准备好!"${END}
76fi
77}
78
79check_fmt_file(){
80if[!-e${FMT_FILE}];then
81${COLOR}"缺少${FMT_FILE}文件!"${END}
82${COLOR}'开始下载fmt包......'${END}
83wget${FMT_URL}${FMT_FILE}||{${COLOR}"fmt包下载失败!"${END};exit;}
84else
85${COLOR}"${FMT_FILE}相关文件已准备好!"${END}
86fi
87}
88
89check_cmake_file(){
90if[!-e${CMAKE_FILE}];then
91${COLOR}"缺少${CMAKE_FILE}文件!"${END}
92${COLOR}'开始下载cmake二进制包......'${END}
93wget${CMAKE_URL}${CMAKE_FILE}||{${COLOR}"cmake二进制包下载失败!"${END};exit;}
94else
95${COLOR}"${CMAKE_FILE}相关文件已准备好!"${END}
96fi
97}
98
99check_file(){
100cd${SRC_DIR}
101    check_mysql_file
102    check_fmt_file
103if[${MAIN_NAME}=="CentOS"-a${MAIN_VERSION_ID}==7];then
104        check_cmake_file
105fi
106if[${MAIN_NAME}=="Ubuntu"-a${MAIN_VERSION_ID}==18];then
107        check_cmake_file
108fi
109}
110
111install_cmake(){
112${COLOR}'开始安装cmake,请稍等......'${END}
113tar xf ${CMAKE_FILE}-C /usr/local/
114CMAKE_DIR=`echo ${CMAKE_FILE}|sed-nr's/^(.*[0-9]).*/\1/p'`
115ln-s /usr/local/${CMAKE_DIR}/bin/cmake /usr/bin/
116}
117
118install_mariadb(){
119[-d${INSTALL_DIR}]&&{${COLOR}"MariaDB数据库已存在,安装失败!"${END};exit;}
120${COLOR}"开始安装MariaDB数据库......"${END}
121if[${MAIN_NAME}=="openSUSE"];then
122id mysql &> /dev/null ||{groupadd-r mysql &&useradd-s /sbin/nologin -d${DATA_DIR}-r-g mysql mysql;${COLOR}"成功创建mysql用户!"${END};}
123else
124id mysql &> /dev/null ||{useradd-r-s /sbin/nologin -d${DATA_DIR} mysql ;${COLOR}"成功创建mysql用户!"${END};}
125fi
126[-d${DATA_DIR}]||mkdir-p${DATA_DIR}&> /dev/null
127chown-R mysql:mysql ${DATA_DIR}
128${COLOR}'开始安装MariaDB依赖包,请稍等......'${END}
129if[${MAIN_NAME}=="Rocky"];then
130if[${MAIN_VERSION_ID}==8];then
131            yum install-y cmake gcc gcc-c++ openssl-devel ncurses-devel systemd-devel &> /dev/null
132else
133            yum install-y cmake gcc gcc-c++ openssl-devel ncurses-devel pcre2-devel systemd-devel &> /dev/null
134fi
135fi
136if[${MAIN_NAME}=="AlmaLinux"];then
137if[${MAIN_VERSION_ID}==8];then
138            yum install-y cmake gcc gcc-c++ openssl-devel ncurses-devel systemd-devel &> /dev/null
139else
140            yum install-y cmake gcc gcc-c++ openssl-devel ncurses-devel pcre2-devel systemd-devel &> /dev/null
141fi
142fi
143
144if[${MAIN_NAME}=="CentOS"];then
145if[${MAIN_VERSION_ID}==7];then
146            yum install-y gcc gcc-c++ openssl-devel ncurses-devel pcre2-devel systemd-devel &> /dev/null
147elif[${MAIN_VERSION_ID}==8];then
148            yum install-y cmake gcc gcc-c++ openssl-devel ncurses-devel systemd-devel &> /dev/null
149else
150            yum install-y cmake openssl-devel ncurses-devel pcre2-devel systemd-devel &> /dev/null
151fi
152fi
153if[${MAIN_NAME}=="openEuler"];then
154if[${MAIN_VERSION_ID}==22];then
155            yum install-y cmake make gcc gcc-c++ openssl-devel ncurses-devel systemd-devel &> /dev/null
156else
157            yum install-y cmake make gcc gcc-c++ openssl-devel ncurses-devel pcre2-devel systemd-devel &> /dev/null
158fi
159fi
160if[${MAIN_NAME}=="Anolis"];then
161if[${MAIN_VERSION_ID}==8];then
162            yum install-y cmake gcc gcc-c++ openssl-devel ncurses-devel systemd-devel &> /dev/null
163else
164            yum install-y cmake gcc gcc-c++ openssl-devel ncurses-devel pcre2-devel systemd-devel &> /dev/null
165fi
166fi
167if[${MAIN_NAME}=='OpenCloudOS'];then
168if[${MAIN_VERSION_ID}==8];then
169            yum install-y cmake gcc gcc-c++ openssl-devel ncurses-devel systemd-devel &> /dev/null
170else
171            yum install-y cmake gcc gcc-c++ openssl-devel ncurses-devel pcre2-devel systemd-devel &> /dev/null
172fi
173fi
174if[${MAIN_NAME}=="Kylin"];then
175if[${MAIN_VERSION_ID}==10];then
176            yum install-y cmake make gcc gcc-c++ openssl-devel ncurses-devel systemd-devel &> /dev/null
177else
178            yum install-y cmake make gcc gcc-c++ openssl-devel ncurses-devel pcre2-devel systemd-devel &> /dev/null
179fi
180fi
181if[${MAIN_NAME}=="UOS"];then
182if[${MAIN_VERSION_ID}==20];then
183            yum install-y cmake ncurses-devel systemd-devel &> /dev/null
184fi
185fi
186if[${MAIN_NAME}=="openSUSE"];then
187if[${MAIN_VERSION_ID}==15];then
188zypperinstall-y cmake gcc gcc-c++ libopenssl-devel ncurses-devel pcre2-devel systemd-devel &> /dev/null
189fi
190fi
191if[${MAIN_NAME}=="Ubuntu"];then
192if[${MAIN_VERSION_ID}==18];then
193apt update &&aptinstall-y g++ libssl-dev libncurses5-dev libpcre2-dev libsystemd-dev
194else
195apt update &&aptinstall-y cmake g++ libssl-dev libncurses5-dev libpcre2-dev libsystemd-dev
196fi
197fi
198if[${MAIN_NAME}=='Debian'];then
199apt update &&aptinstall-y cmake g++ libssl-dev libncurses5-dev libpcre2-dev libsystemd-dev
200fi
201if[${MAIN_NAME}=="CentOS"-a${MAIN_VERSION_ID}==7];then
202        install_cmake
203fi
204if[${MAIN_NAME}=='Ubuntu'-a${MAIN_VERSION_ID}==18];then
205        install_cmake
206fi
207${COLOR}'开始编译安装MariaDB,请稍等......'${END}
208cd${SRC_DIR}
209if[${MAIN_NAME}=="openEuler"];then
210if[${MAIN_VERSION_ID}==22-o${MAIN_VERSION_ID}==24];then
211            yum install-ytar&> /dev/null
212fi
213fi
214if[${MAIN_NAME}=="Anolis"];then
215if[${MAIN_VERSION_ID}==23];then
216            yum install-ytar&> /dev/null
217fi
218fi
219if[${MAIN_NAME}=="OpenCloudOS"];then
220if[${MAIN_VERSION_ID}==9];then
221            yum install-ytar&> /dev/null
222fi
223fi
224tar xf ${MARIADB_FILE}
225MARIADB_DIR=`echo ${MARIADB_FILE}|sed-nr's/^(.*[0-9]).*/\1/p'`
226mkdir-p /usr/local/src/${MARIADB_DIR}/extra/libfmt/src/
227mv${FMT_FILE} /usr/local/src/${MARIADB_DIR}/extra/libfmt/src/
228cd${MARIADB_DIR}
229    cmake .\
230-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}\
231-DMYSQL_DATADIR=${DATA_DIR}/ \
232-DSYSCONFDIR=/etc/ \
233-DMYSQL_USER=mysql \
234-DWITH_INNOBASE_STORAGE_ENGINE=1\
235-DWITH_ARCHIVE_STORAGE_ENGINE=1\
236-DWITH_BLACKHOLE_STORAGE_ENGINE=1\
237-DWITH_PARTITION_STORAGE_ENGINE=1\
238-DWITHOUT_MROONGA_STORAGE_ENGINE=1\
239-DWITH_DEBUG=0\
240-DWITH_READLINE=1\
241-DWITH_SSL=system \
242-DWITH_ZLIB=system \
243-DWITH_PCRE=system \
244-DWITH_BOOST=system \
245-DWITH_LIBWRAP=0\
246-DENABLED_LOCAL_INFILE=1\
247-DMYSQL_UNIX_ADDR=${DATA_DIR}/mariadb.sock \
248-DDEFAULT_CHARSET=utf8mb4 \
249-DDEFAULT_COLLATION=utf8mb4_general_ci \
250-DWITH_SYSTEMD=yes
251make-j$(nproc)&&makeinstall
252[$?-eq0]&&${COLOR}"MariaDB编译安装成功"${END}||{${COLOR}"MariaDB编译安装失败,退出!"${END};exit;}
253echo'PATH='${INSTALL_DIR}'/bin:$PATH'> /etc/profile.d/mariadb.sh
254.  /etc/profile.d/mariadb.sh
255chown-R mysql:mysql ${INSTALL_DIR}
256cd${INSTALL_DIR}
257    ./scripts/mysql_install_db --datadir=${DATA_DIR}--user=mysql
258cat> /etc/my.cnf <<-EOF
259[mariadb]
260basedir=${INSTALL_DIR}/
261datadir=${DATA_DIR}
262port=3306
263socket=${DATA_DIR}/mariadb.sock
264pid-file=${DATA_DIR}/mariadb.pid
265log-error=${DATA_DIR}/mariadb.log
266
267[client]
268port=3306
269socket=${DATA_DIR}/mariadb.sock
270EOF
271if[${MAIN_NAME}=="Ubuntu"-o${MAIN_NAME}=="Debian"];then
272cp${INSTALL_DIR}/support-files/systemd/mariadb.service /lib/systemd/system/
273else
274cp${INSTALL_DIR}/support-files/systemd/mariadb.service /usr/lib/systemd/system/
275fi
276    systemctl daemon-reload && systemctl enable--now mariadb &> /dev/null
277[$?-ne0]&&{${COLOR}"数据库启动失败,退出!"${END};exit;}
278}
279
280mariadb_secure(){
281${INSTALL_DIR}/bin/mariadb-secure-installation <<EOF
282
283y
284n
285y
286y
287y
288y
289EOF
290${COLOR}"${FULL_NAME}操作系统,MariaDB数据库安装完成!"${END}
291}
292
293main(){
294    check_file
295    install_mariadb
296    mariadb_secure
297}
298
299if[${MAIN_NAME}=="Rocky"];then
300if[${MAIN_VERSION_ID}==8-o${MAIN_VERSION_ID}==9-o${MAIN_VERSION_ID}==10];then
301        main
302fi
303elif[${MAIN_NAME}=="AlmaLinux"];then
304if[${MAIN_VERSION_ID}==8-o${MAIN_VERSION_ID}==9-o${MAIN_VERSION_ID}==10];then
305        main
306fi
307elif[${MAIN_NAME}=="CentOS"];then
308if[${MAIN_VERSION_ID}==7-o${MAIN_VERSION_ID}==8-o${MAIN_VERSION_ID}==9-o${MAIN_VERSION_ID}==10];then
309        main
310fi
311elif[${MAIN_NAME}=="openEuler"];then
312if[${MAIN_VERSION_ID}==22-o${MAIN_VERSION_ID}==24];then
313        main
314fi
315elif[${MAIN_NAME}=="Anolis"];then
316if[${MAIN_VERSION_ID}==8-o${MAIN_VERSION_ID}==23];then
317        main
318fi
319elif[${MAIN_NAME}=='OpenCloudOS'];then
320if[${MAIN_VERSION_ID}==8-o${MAIN_VERSION_ID}==9];then
321        main
322fi
323elif[${MAIN_NAME}=="Kylin"];then
324if[${MAIN_VERSION_ID}==10-o${MAIN_VERSION_ID}==11];then
325        main
326fi
327elif[${MAIN_NAME}=="UOS"];then
328if[${MAIN_VERSION_ID}==20];then
329        main
330fi
331elif[${MAIN_NAME}=="openSUSE"];then
332if[${MAIN_VERSION_ID}==15];then
333        main
334fi
335elif[${MAIN_NAME}=="Ubuntu"];then
336if[${MAIN_VERSION_ID}==18-o${MAIN_VERSION_ID}==20-o${MAIN_VERSION_ID}==22-o${MAIN_VERSION_ID}==24];then
337        main
338fi
339elif[${MAIN_NAME}=='Debian'];then
340if[${MAIN_VERSION_ID}==11-o${MAIN_VERSION_ID}==12-o${MAIN_VERSION_ID}==13];then
341        main
342fi
343else
344${COLOR}"此脚本不支持${FULL_NAME}操作系统!"${END}
345fi

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 2.4.6 生成数据库文件
  • 2.4.7 准备配置文件
  • 2.4.8 准备启动脚本并启动服务
  • 2.4.9 安全初始化
  • 2.4.10 登录测试
  • 2.4.11 一键安装MariaDB源码编译的脚本
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档