如何在Debian 9 / Debian 8上安装MariaDB 10.3

原作者:Josphat Mutai  翻译&转载来源:https://computingforgeeks.com/how-to-install-mariadb-10-3-on-debian-9-debian-8/

如何在Debian 9 / Debian 8上安装MariaDB 10.3

大家好!在本指南中,我们将介绍如何在Debian 9 Stretch和Debian 8 Jessie上安装MariaDB 10.3。MariaDB是一个在通用公共许可证版本2下发布的开源数据库服务器。在撰写本文时,MariaDB 10.3是MariaDB的当前主要稳定版本,这将支持到2023年5月。对于MariaDB 10.3的所有功能,请检查功能页面。

对于CentOS 7和Ubuntu 18.04,请检查:   在Ubuntu 18.04和CentOS 7上安装MariaDB 10.x

对于Ubuntu 16.04使用  如何在Ubuntu 16.04 LTS(Xenial)上安装MariaDB 10.3

如何在Debian 9 / Debian 8上安装MariaDB 10.3

在下载和安装MariaDB 10.3之前,您需要添加官方MariaDB上游存储库。这包含MariaDB的二进制包。添加如下:

第1步:安装依赖包

sudo apt-get install software-properties-common dirmngr

第2步:添加MariaDB 10.3存储库并导入GPG密钥

对于Debian 9:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
sudo add-apt-repository'deb [arch = amd64,i386,ppc64el] http://mirror.zol.co.zw/mariadb/repo/10.3/debian stretch main'

对于Debian 8:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
sudo add-apt-repository'deb [arch = amd64,i386,ppc64el] http://mirror.zol.co.zw/mariadb/repo/10.3/debian jessie main'

导入密钥并添加存储库后,您可以使用以下命令安装MariaDB:

sudo apt-get update && sudo apt-get install mariadb-server

当提示您设置root密码时,请提供密码并确认。

完成后,它将完成安装并启动mysql服务。您可以使用以下方式检查状

$ sudo systemctl status mysql

●mariadb.service  -  MariaDB 10.3.8数据库服务器
已加载:已加载(/lib/systemd/system/mariadb.service;已启用;供应商预设:已启用)
Drop-In:/etc/systemd/system/mariadb.service.d
└─migrated从 -  my.cnf中,settings.conf
活跃:自2018-08-10 10:38:08 UTC以来活跃(正在运行); 34分钟前
文件:man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
主PID:5468(mysqld)
状态:“立即提出您的SQL请求......”
CGroup:/system.slice/mariadb.service
└─5468/ usr / sbin / mysqld

您也可以登录以检查数据库版本:

root@debian-9:~# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.3.8-MariaDB-1:10.3.8+maria~stretch-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> select version();
+-------------------------------------------+
| version()                                 |
+-------------------------------------------+
| 10.3.8-MariaDB-1:10.3.8+maria~stretch-log |
+-------------------------------------------+
1 row in set (0.000 sec)

MariaDB [(none)]> 

就这样。喜欢在Debian 9 / Debian 8服务器上运行MariaDB 10.3。

猜你喜欢

转载自blog.csdn.net/Aria_Miazzy/article/details/84980802