介绍 (Introduction)
MariaDB is an open-source relational database management system, commonly used as an alternative for MySQL as the database portion of the popular LAMP (Linux, Apache, MySQL, PHP/Python/Perl) stack. It is intended to be a drop-in replacement for MySQL.
MariaDB是一个开放源代码的关系数据库管理系统,通常用作MySQL的替代方案,作为流行的LAMP (Linux,Apache,MySQL,PHP / Python / Perl)堆栈的数据库部分。 它旨在替代MySQL。
The short version of this installation guide consists of these three steps:
本安装指南的简短版本包括以下三个步骤:
Update your package index using
apt
使用
apt
更新您的软件包索引Install the
mariadb-server
package usingapt
. The package also pulls in related tools to interact with MariaDB使用
apt
安装mariadb-server
软件包。 该软件包还引入了与MariaDB交互的相关工具Run the included
mysql_secure_installation
security script to restrict access to the server运行附带的
mysql_secure_installation
安全脚本以限制对服务器的访问
- sudo apt update sudo apt更新
- sudo apt install mariadb-server sudo apt安装mariadb-server
- sudo mysql_secure_installation 须藤mysql_secure_installation
This tutorial will explain how to install MariaDB on an Ubuntu 20.04 server and verify that it is running and has a safe initial configuration.
本教程将说明如何在Ubuntu 20.04服务器上安装MariaDB并验证其是否正在运行并具有安全的初始配置。
先决条件 (Prerequisites)
To follow this tutorial, you will need a server running Ubuntu 20.04. This server should have a non-root administrative user and a firewall configured with UFW. Set this up by following our initial server setup guide for Ubuntu 20.04.
要遵循本教程,您将需要一台运行Ubuntu 20.04的服务器。 此服务器应具有非root用户管理权限,并应使用UFW配置防火墙。 请遵循我们针对Ubuntu 20.04的初始服务器设置指南进行设置 。
第1步-安装MariaDB (Step 1 — Installing MariaDB)
As of this writing, Ubuntu 20.04’s default APT repositories include MariaDB version 10.3.
在撰写本文时,Ubuntu 20.04的默认APT存储库包括MariaDB版本10.3 。
To install it, update the package index on your server with apt
: