MariaDB 설치 (.deb 다운로드)

You are viewing an old version of this article. View the current version here.

APT를 사용한 MariaDB 설치

Debian, Ubuntu, 그리고 다른 유사한 Linux 배포판에서는 apt, aptitude, Ubuntu Software Center, Synaptic Package Manager, 또는 다른 패키지 매니저를 사용하여 MariaDB의 저장소에서 관련 .deb 패키지를 설치할 수 있습니다.

이 페이지에서는 apt를 사용한 간단한 설치 단계를 안내합니다.

APT 저장소에 MariaDB 추가하기

현재 다음 Linux 배포판에 대한 APT 저장소가 있습니다.:

  • Debian 9 (Jessie)
  • Debian 10 (Buster)
  • Debian 11 (Bullseye)
  • Debian Unstable (Sid)
  • Ubuntu 18.04 LTS (Bionic)
  • Ubuntu 20.04 LTS (Focal)
  • Ubuntu 20.10 (Groovy)
  • Ubuntu 21.04 (Hirsute)
  • Ubuntu 21.10 (Impish)

MariaDB 패키지 저장소(MariaDB Package Repository) 설치

apt를 사용하여 MariaDB를 설치할 경우, MariaDB Repository 설치 스크립트(MariaDB Package Repository setup script)를 사용하여 apt에서 MariaDB 재단에서 제공하는 MariaDB 패키지 저장소를 참조하여 설치하도록 할 수 있습니다.

MariaDB 재단은 apt를 사용하여 패키지를 관리하는 여러 리눅스 배포판을 위한 MariaDB 패키지 저장소를 제공합니다. 이 저장소에는 MariaDB 서버, 클라리언트 및 유틸리티, 클라이언트 라이브러리, 플러그인Mariabackup을 포함하여 MariaDB 서버와 관련된 소프트웨어 패키지가 포함되어있습니다.MariaDB Repository 설치 스크립트는 MariaDB 패키지 저장소를 참조하여 패키지를 시스템에 자동으로 설치 및 구성합니다.

스크립트를 사용하려면 다음 명령을 실행하십시오 :

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash

참조 위 스크립트는 MariaDB MaxScale과 MariaDB Tools용 저장소도 구성합니다만, Percona XtraBackup 및 해당 종속성에서만 구성됩니다.

자세한 내용은 MariaDB Package Repository Setup and Usage를 참조하십시오.

MariaDB 저장소 구성 도구(MariaDB Repository Configuration Tool) 사용

당신이 apt를 사용하여 MariaDB를 설치할 경우, MariaDB Repository Configuration Tool을 사용하여 MariaDB 재단의 MariaDB 저장소(MariaDB Repository)를 참조하여 MariaDB를 설치하도록 apt를 구성할 수 있습니다.

MariaDB재단은 apt-get을 사용하여 패키지 관리를 하는 여러 리눅스 배포판을 위해서 MariaDB Package Repository를 제공합니다. 이 저장소에는 MariaDB 서버, 클라리언트 및 유틸리티, 클라이언트 라이브러리, 플러그인Mariabackup을 포함하여 MariaDB 서버와 관련된 소프트웨어 패키지가 포함되어있습니다. MariaDB 리포지토리 구성 도구는 배포용 리포지토리를 추가하기 위한 적절한 명령을 쉽게 생성할 수 있습니다.

저장소를 추가하는 방법에는 여러 가지가 있습니다.

add-apt-repository 사용

apt repository에 추가하는 방법 중 하나는 add-apt-repository 명령어입니다. 이 명령어는 /etc/apt/sources.list(apt 리포지토리에서 사용하는 패키지 목록 폴더)에 저장소 구성을 추가하는 명령어입니다.

예를 들어 apt-get 저장소를 이용하여 Ubuntu 18.04 LTS(Bionic)에 MariaDB 10.3을 설치하려는 경우 다음 명령을 사용하여 MariaDB apt 저장소를 추가할 수 있습니다.:

sudo apt-get install software-properties-common
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu bionic main'

그런 다음 다음 명령을 실행하여 패키지 캐시를 업데이트해야 합니다. (패키지 캐시를 업데이트 안할 경우 apt에서 인식을 못할 수 있습니다.) :

sudo apt update
소스 목록(Source List) 파일 생성

apt 리포지토리에 추가하는 또 다른 방법은 /etc/apt/sources.list.d/ 폴더 안에 source.list 파일을 만드는 것 입니다.

예를 들어 리포지토리를 사용하여 Ubuntu 18.04 LTS(Bionic)에 MariaDB 10.3를 설치하려는 경우, /etc/apt/sources.list.d/ 폴더안에 MariaDB.list 파일을 다음 내용으로 생성하면 MariaDB apt 리포지토리를 추가할 수 있습니다.

# MariaDB 10.3 repository list - created 2019-01-27 09:50 UTC
# http://downloads.mariadb.org/mariadb/repositories/
deb [arch=amd64,arm64,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu bionic main
deb-src http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu bionic main

그런 다음 다음 명령을 실행하여 패키지 캐시를 업데이트해야 합니다 (패키지 캐시를 업데이트 안할 경우 apt에서 인식을 못할 수 있습니다.) :

sudo apt update
Ubuntu Software Center 사용

apt 저장소에 추가하는 또 다른 방법은 Ubuntu Software Center를 사용하는 것입니다.

당신은 Software Sources창으로 이동하여 이를 수행할 수 있습니다. 이 창은 Edit > Software Sources 으로 이동하거나 System > Administration > Software Sources로 이동하여 열 수 있습니다.

Software Sources 창이 열리면 Other Software탭으로 이동하여 Add(추가) 버튼을 클릭 합니다. 이때 MariaDB Repository Configuration Tool에서 제공하는 저정소 정보를 입력할 수 있습니다.

자세한 내용은 여기 를 참조하세요.

Synaptic Package Manager (시냅틱 패키지 관리자) 사용

apt 저장소에 추가하는 또 다른 방법은 Synaptic Package Manager를 사용하는 것입니다..

당신은 Software Sources 창으로 이동하여 이를 수행할 수 있습니다. 이 창은 System > Administrator > Software Sources로 이동하거나 Settings > Repositories로 이동하여 열 수 있습니다.

Software Sources창이 열리면, Other Software 탭으로 이동하여 Add(추가) 버튼을 클릭 합니다. 이때 MariaDB Repository Configuration Tool에서 제공하는 저장소 정보를 입력할 수 있습니다..

자세한 내용은 여기를 참조하세요.

특정 마이너 릴리스로 설치(구성)하기

(Pinning the MariaDB Repository to a Specific Minor Release)

만약 당신이 특정 마이너 릴리스를 apt 저장소에 구성하려고 하는 경우, 또는 특정 마이너 릴리스로 다운그레이하려고하는 경우, 당신은 하드 코딩된 URL을 사용하여 해당 버전을 apt 저장소에 추가할 수 있습니다.

MariaDB재단은 다음 URL에서 이전 마이너 릴리스의 저장소를 보관합니다 :

아카이브는 릴리스 당시 지원되는 배포판 및 아키텍처 중 하나입니다. 예를 들어 MariaDB 10.0.38(https://archive.mariadb.org/mariadb-10.0.38/repo/ubuntu/dists)은 Ubuntu precise(12.04), trusty(14.04), xenial(16.04), wily(15.10), yakkety(16.10)에서만 존재합니다.

예를 들어 Ubuntu 20.04 LTS(Focal)에 MariaDB 10.5.9 저장소를 구성하려고 하는 경우, 먼저 존재하는 MariaDB 저장소 소스 목록 파일을 /etc/apt/sources.list.d/ 폴더에서 지운 후, 다음 명령어를 사용하여 apt-get 저장소에 추가할 수 있다.

sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el,s390x] http://archive.mariadb.org/mariadb-10.5.9/repo/ubuntu/ focal main main/debug'

문제가 생길 경우 signing key(MariaDB GPG Public Key)가 설치되어 있는지 확인하십시오. (영문 Importing the MariaDB GPG Public Key)

Ubuntu Xenial and older will need:

sudo apt-get install -y apt-transport-https

And then you would have to update the package cache by executing the following command:

sudo apt update

Updating the MariaDB APT repository to a New Major Release

MariaDB's apt repository can be updated to a new major release. How this is done depends on how you originally configured the repository.

Updating the Major Release with the MariaDB Package Repository Setup Script

If you configured apt to install from MariaDB Corporation's MariaDB Package Repository by using the MariaDB Package Repository setup script, then you can update the major release that the repository uses by running the script again.

Updating the Major Release with the MariaDB Repository Configuration Tool

If you configured apt to install from MariaDB Foundation's MariaDB Repository by using the MariaDB Repository Configuration Tool, then you can update the major release in various ways, depending on how you originally added the repository.

Updating a Repository with add-apt-repository

If you added the apt repository by using the add-apt-repository command, then you can update the major release that the repository uses by using the the add-apt-repository command again.

First, look for the repository string for the old version in /etc/apt/sources.list.

And then, you can remove the repository for the old version by executing the add-apt-repository command and providing the --remove option. For example, if you wanted to remove a MariaDB 10.2 repository, then you could do so by executing something like the following:

sudo add-apt-repository --remove 'deb [arch=amd64,arm64,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/ubuntu bionic main'

After that, you can add the repository for the new version with the add-apt-repository command. For example, if you wanted to use the repository to install MariaDB 10.3 on Ubuntu 18.04 LTS (Bionic), then you could use the following commands to add the MariaDB apt repository:

sudo apt-get install software-properties-common
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu bionic main'

And then you would have to update the package cache by executing the following command:

sudo apt update

After that, the repository should refer to MariaDB 10.3.

Updating a Source List File

If you added the apt repository by creating a source list file in /etc/apt/sources.list.d/, then you can update the major release that the repository uses by updating the source list file in-place. For example, if you wanted to change the repository from MariaDB 10.2 to MariaDB 10.3, and if the source list file was at /etc/apt/sources.list.d/MariaDB.list, then you could execute the following:

sudo sed -i 's/10.2/10.3/' /etc/apt/sources.list.d/MariaDB.list

And then you would have to update the package cache by executing the following command:

sudo apt update

After that, the repository should refer to MariaDB 10.3.

MariaDB GPG Public Key 추가하기

Before MariaDB can be installed, you also have to import the GPG public key that is used to verify the digital signatures of the packages in our repositories. This allows the apt utility to verify the integrity of the packages that it installs.

  • Prior to Debian 9 (Stretch), and Debian Unstable (Sid), and Ubuntu 16.04 LTS (Xenial), the id of our GPG public key is 0xcbcb082a1bb943db. The full key fingerprint is:
1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB

The apt-key utility can be used to import this key. For example:

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
  • Starting with Debian 9 (Stretch) and Ubuntu 16.04 LTS (Xenial), the id of our GPG public key is 0xF1656F24C74CD1D8. The full key fingerprint is:
177F 4010 FE56 CA33 3630  0305 F165 6F24 C74C D1D8

The apt-key utility can be used to import this key. For example:

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

Starting with Debian 9 (Stretch), the dirmngr package needs to be installed before the GPG public key can be imported. To install it, execute: sudo apt install dirmngr

If you are unsure which GPG public key you need, then it is perfectly safe to import both keys.

The command used to import the GPG public key is the same on both Debian and Ubuntu. For example:

$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /tmp/tmp.ASyOPV87XC --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
gpg: requesting key 1BB943DB from hkp server keyserver.ubuntu.com
gpg: key 1BB943DB: "MariaDB Package Signing Key <package-signing-key@mariadb.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1

Once the GPG public key is imported, you are ready to install packages from the repository.

Installing MariaDB Packages with APT

After the apt repository is configured, you can install MariaDB by executing the apt-get command. The specific command that you would use would depend on which specific packages that you want to install.

Installing the Most Common Packages with APT

To Install the most common packages, first you would have to update the package cache by executing the following command:

sudo apt update
MariaDB starting with 10.4

In MariaDB 10.4 and later, to Install the most common packages, execute the following command:

sudo apt-get install mariadb-server galera-4 mariadb-client libmariadb3 mariadb-backup mariadb-common
MariaDB 10.2 - 10.3

In MariaDB 10.2 and MariaDB 10.3, to Install the most common packages, execute the following command:

sudo apt-get install mariadb-server galera mariadb-client libmariadb3 mariadb-backup mariadb-common
MariaDB until 10.1

In MariaDB 10.1 and before, to Install the most common packages, execute the following command:

sudo apt-get install mariadb-server galera mariadb-client libmysqlclient18 mariadb-backup mariadb-common

Installing MariaDB Server with APT

To Install MariaDB Server, first you would have to update the package cache by executing the following command:

sudo apt update

Then, execute the following command:

sudo apt-get install mariadb-server

Installing MariaDB Galera Cluster with APT

The process to install MariaDB Galera Cluster with the MariaDB apt-get repository is practically the same as installing standard MariaDB Server.

In MariaDB 10.1 and later, Galera Cluster support has been included in the standard MariaDB Server packages, so you will need to install the mariadb-server package, as you normally would.

In MariaDB 10.4 and later, you also need to install the galera-4 package to obtain the Galera 4 wsrep provider library.

In MariaDB 10.3 and before, you also need to install the galera-3 package to obtain the Galera 3 wsrep provider library.

To install MariaDB Galera Cluster, first you would have to update the package cache by executing the following command:

sudo apt update
MariaDB starting with 10.4

In MariaDB 10.4 and later, to install MariaDB Galera Cluster, you could execute the following command:

sudo apt-get install mariadb-server mariadb-client galera-4
MariaDB until 10.3

In MariaDB 10.3 and before, to install MariaDB Galera Cluster, you could execute the following command:

sudo apt-get install mariadb-server mariadb-client galera-3

MariaDB Galera Cluster also has a separate package that can be installed on arbitrator nodes. In MariaDB 10.4 and later, the package is called galera-arbitrator-4 In MariaDB 10.3 and before, the package is called galera-arbitrator-3. This package should be installed on whatever node you want to serve as the arbitrator. It can either run on a separate server that is not acting as a cluster node, which is the recommended configuration, or it can run on a server that is also acting as an existing cluster node.

MariaDB starting with 10.4

In MariaDB 10.4 and later, to install the arbitrator package, you could execute the following command:

sudo apt-get install galera-arbitrator-4
MariaDB until 10.3

In MariaDB 10.3 and before, to install the arbitrator package, you could execute the following command:

sudo apt-get install galera-arbitrator-3

See MariaDB Galera Cluster for more information on MariaDB Galera Cluster.

Installing MariaDB Clients and Client Libraries with APT

In MariaDB 10.2 and later, MariaDB Connector/C has been included as the client library.

To Install the clients and client libraries, first you would have to update the package cache by executing the following command:

sudo apt update

Then, in MariaDB 10.2 and later, execute the following command:

sudo apt-get install mariadb-client libmariadb3

Or in MariaDB 10.1 and before, execute the following command:

sudo apt-get install mariadb-client libmysqlclient18

Installing Mariabackup with APT

To install Mariabackup, first you would have to update the package cache by executing the following command:

sudo apt update

Then, execute the following command:

sudo apt-get install mariadb-backup

Installing Plugins with APT

Some plugins may also need to be installed.

For example, to install the cracklib_password_check password validation plugin, first you would have to update the package cache by executing the following command:

sudo apt update

Then, execute the following command:

sudo apt-get install mariadb-cracklib-password-check

Installing Older Versions from the Repository

The MariaDB apt repository contains the last few versions of MariaDB. To show what versions are available, use the apt-cache command:

sudo apt-cache showpkg mariadb-server

In the output you will see the available versions.

To install an older version of a package instead of the latest version we just need to specify the package name, an equal sign, and then the version number.

However, when installing an older version of a package, if apt-get has to install dependencies, then it will automatically choose to install the latest versions of those packages. To ensure that all MariaDB packages are on the same version in this scenario, it is necessary to specify them all. Therefore, to install MariaDB 10.3.14 from this apt repository, we would do the following:

sudo apt-get install mariadb-server=10.3.14-1 mariadb-client=10.3.14-1 libmariadb3=10.3.14-1 mariadb-backup=10.3.14-1 mariadb-common=10.3.14-1

The rest of the install and setup process is as normal.

Installing MariaDB with dpkg

While it is not recommended, it is possible to download and install the .deb packages manually. However, it is generally recommended to use a package manager like apt-get.

A tarball that contains the .deb packages can be downloaded from the following URL:

For example, to install the MariaDB 10.4.8 .deb packages on Ubuntu 18.04 LTS (Bionic), you could execute the following:

sudo apt-get update
sudo apt-get install libdbi-perl libdbd-mysql-perl psmisc libaio1 socat
wget https://downloads.mariadb.com/MariaDB/mariadb-10.4.8/repo/ubuntu/mariadb-10.4.8-ubuntu-bionic-amd64-debs.tar
tar -xvf mariadb-10.4.8-ubuntu-bionic-amd64-debs.tar
cd mariadb-10.4.8-ubuntu-bionic-amd64-debs/
sudo dpkg --install ./mariadb-common*.deb \
   ./mysql-common*.deb \
   ./mariadb-client*.deb \
   ./libmariadb3*.deb \
   ./libmysqlclient18*.deb 
sudo dpkg --install ./mariadb-server*.deb \
   ./mariadb-backup*.deb \
   ./galera-4*.deb 

After Installation

After the installation is complete, you can start MariaDB.

If you are using MariaDB Galera Cluster, then keep in mind that the first node will have to be bootstrapped.

Installation Issues

MariaDB starting with 5.5

Upgrading mariadb-server and mariadb-client packages

As noted in MDEV-4266, the mariadb-server and mariadb-client packages have a minor upgrade issue if you use 'apt-get install mariadb-server' or 'apt-get install mariadb-client' to upgrade them instead of the more common 'apt-get upgrade'. This is because those two packages depend on mariadb-server-5.5 and mariadb-client-5.5 with no specific version of those packages. For example, if you have the mariadb-server package installed, version 5.5.29 and you install version 5.5.30 of that package it will not automatically upgrade the mariadb-server-5.5 package to version 5.5.30 like you would expect because the 5.5.29 version of that package satisfies the dependency.

The mariadb-server and mariadb-client packages are virtual packages, they only exist to require the installation of the mariadb-server-5.5 and mariadb-client-5.5 packages, respectively. MariaDB will function normally with a, for example, version 5.5.30 version of the mariadb-server package and a version 5.5.29 version of the mariadb-server-5.5 package. No data is at risk. However, expected behavior is for 'apt-get install mariadb-server' to upgrade everything to the latest version (if a new version is available), so this is definitely a bug.

A fix is planned for this bug in a future version of MariaDB. In the mean time, when upgrading MariaDB, use 'apt-get upgrade' or 'apt-get install mariadb-server-5.5'.

Available DEB Packages

The available DEB packages depend on the specific MariaDB release series.

Available DEB Packages in MariaDB 10.4

MariaDB starting with 10.4

In MariaDB 10.4, the following DEBs are available:

Package NameDescription
galera-4The WSREP provider for Galera 4.
libmariadb3Dynamic client libraries.
libmariadb-devDevelopment headers and static libraries.
libmariadbclient18Virtual package to satisfy external depends
libmysqlclient18Virtual package to satisfy external depends
mariadb-backupMariabackup
mariadb-clientClient tools like mysql CLI, mysqldump, and others.
mariadb-client-coreCore client tools
mariadb-commonCharacter set files and /etc/my.cnf
mariadb-plugin-connectThe CONNECT storage engine.
mariadb-plugin-cracklib-password-checkThe cracklib_password_check password validation plugin.
mariadb-plugin-gssapi-clientThe client-side component of the gssapi authentication plugin.
mariadb-plugin-gssapi-serverThe server-side component of the gssapi authentication plugin.
mariadb-plugin-rocksdbThe MyRocks storage engine.
mariadb-plugin-spiderThe SPIDER storage engine.
mariadb-plugin-tokudbThe TokuDB storage engine.
mariadb-serverThe server and server tools, like myisamchk and mysqlhotcopy are here.
mariadb-server-coreThe core server.
mariadb-testmysql-client-test executable, and mysql-test framework with the tests.
mariadb-test-dataMariaDB database regression test suite - data files

Available DEB Packages in MariaDB 10.2 and MariaDB 10.3

MariaDB starting with 10.2

In MariaDB 10.2 and MariaDB 10.3, the following DEBs are available:

Package NameDescription
galeraThe WSREP provider for Galera 3.
libmariadb3Dynamic client libraries.
libmariadb-devDevelopment headers and static libraries.
libmariadbclient18Virtual package to satisfy external depends
libmysqlclient18Virtual package to satisfy external depends
mariadb-backupMariabackup
mariadb-clientClient tools like mysql CLI, mysqldump, and others.
mariadb-client-coreCore client tools
mariadb-commonCharacter set files and /etc/my.cnf
mariadb-plugin-connectThe CONNECT storage engine.
mariadb-plugin-cracklib-password-checkThe cracklib_password_check password validation plugin.
mariadb-plugin-gssapi-clientThe client-side component of the gssapi authentication plugin.
mariadb-plugin-gssapi-serverThe server-side component of the gssapi authentication plugin.
mariadb-plugin-rocksdbThe MyRocks storage engine.
mariadb-plugin-spiderThe SPIDER storage engine.
mariadb-plugin-tokudbThe TokuDB storage engine.
mariadb-serverThe server and server tools, like myisamchk and mysqlhotcopy are here.
mariadb-server-coreThe core server.
mariadb-testmysql-client-test executable, and mysql-test framework with the tests.
mariadb-test-dataMariaDB database regression test suite - data files

Available DEB Packages in MariaDB 10.1

MariaDB starting with 10.1

In MariaDB 10.1, the following DEBs are available:

Package NameDescription
galeraThe WSREP provider for Galera 3.
libmysqlclient18Dynamic client libraries.
mariadb-backupMariabackup
mariadb-clientClient tools like mysql CLI, mysqldump, and others.
mariadb-client-coreCore client tools
mariadb-commonCharacter set files and /etc/my.cnf
mariadb-plugin-connectThe CONNECT storage engine.
mariadb-plugin-cracklib-password-checkThe cracklib_password_check password validation plugin.
mariadb-plugin-gssapi-clientThe client-side component of the gssapi authentication plugin.
mariadb-plugin-gssapi-serverThe server-side component of the gssapi authentication plugin.
mariadb-plugin-spiderThe SPIDER storage engine.
mariadb-plugin-tokudbThe TokuDB storage engine.
mariadb-serverThe server and server tools, like myisamchk and mysqlhotcopy are here.
mariadb-server-coreThe core server.
mariadb-testmysql-client-test executable, and mysql-test framework with the tests.
mariadb-test-dataMariaDB database regression test suite - data files

Actions Performed by DEB Packages

Users and Groups Created

When the mariadb-server DEB package is installed, it will create a user and group named mysql, if they do not already exist.

See Also

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.