Ubuntu 中安装 MariaDb 数据库

刘理志 发布于 2010/05/07 12:05
阅读 2K+
收藏 1



Click on the distro and MySQL/MariaDB version of your choice below, and follow the instructions for setting up the repository files. Please run sudo apt-get update to fetch the new list before trying to install or upgrade any of the packages.

Fresh install

For any server installation, simply sudo apt-get install mysql-server (or mariadb-server)

For client connectivity, sudo apt-get install mysql-client (or mariadb-client)

MariaDB 5.1 has a separate mariadb-test package.

All dependencies will be automatically resolved if you install using the repository, including backward compatibility from MariaDB 5.1 (which use a .so.16 client library) to apps that are still linked against a .so.15

Note: You could download the debs manually and install locally with dpkg -i, however dpkg can’t resolve external dependencies (like libdbd-mysql) and thus often fails. Just use the repo, it’s easier!


You must use sudo apt-get dist-upgrade since there is a new mysql-server-core package in the dependency mix (both for 5.0 and 5.1). Regular upgrade does not allow new packages to be installed even for a dependency. Don’t worry, the dist-upgrade term is misleading, it does not upgrade you to the next distro version.

Upgrading from 5.0 (stock distro or OurDelta) to 5.1 should be ok, we’ve tested this just with the packages. Naturally, there may be aspects in your application that need to be checked.

OS/Distro Version Architecture Repositories
Ubuntu 8.04 LTS (Hardy) i386/amd64 MySQL 5.0 OurDelta
MySQL 5.0 OurDelta-Sail
MariaDB 5.1
Ubuntu 8.10 (Intrepid) i386/amd64 MySQL 5.0 OurDelta
MySQL 5.0 OurDelta-Sail
MariaDB 5.1
Ubuntu 9.04 (Jaunty) i386/amd64 MySQL 5.0 OurDelta
MySQL 5.0 OurDelta-Sail
MariaDB 5.1
Ubuntu 9.10 (Karmic) i386/amd64 MySQL 5.0 OurDelta,
MySQL 5.0 OurDelta-Sail
MariaDB 5.1

In some cases we have to make considerable effort to make builds work on older or really new distro releases; as you know, distros themselves don’t bother with it so we have to deal with any breakage. Our objective is to try and keep at least everything going from the last LTS (Long Term Support) release of Ubuntu.

For new releases, we tend to create our VMs when they’re in their beta or RC stage, and we try to have packages out around the time of their release proper (depending on any problems we find, and our build schedule).