# CentOS 6.0 安装 MariaDB 的命令

**URL:** <https://www.isharkfly.com/t/centos-6-0-mariadb/7790>\
**Category:** 数据库\
**Tags:** mariadb, mysql\
**Created:** [July 22, 2013, 9:58pm UTC](https://www.isharkfly.com/t/centos-6-0-mariadb/7790 "2013-07-22T21:58:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [July 22, 2013, 9:58pm UTC](https://www.isharkfly.com/t/centos-6-0-mariadb/7790/1 "2013-07-22T21:58:45Z")

</div>

使用命令如下：

```auto
 yum install MariaDB-server MariaDB-client

```

服务器输出：[code][root@ossez ~]# yum install MariaDB-server MariaDB-client  
Loaded plugins: fastestmirror, security  
Loading mirror speeds from cached hostfile  
mriadb | 1.9 kB 00:00  
mriadb/primary\_db | 15 kB 00:00  
Setting up Install Process  
Resolving Dependencies  
 → Running transaction check  
—\> Package MariaDB-client.x86\_64 0:5.5.32-1 will be installed  
 → Processing Dependency: MariaDB-common for package: MariaDB-client-5.5.32-1.x 86\_64  
—\> Package MariaDB-server.x86\_64 0:5.5.32-1 will be installed  
 → Processing Dependency: perl(DBI) for package: MariaDB-server-5.5.32-1.x86\_64  
 → Running transaction check  
—\> Package MariaDB-common.x86\_64 0:5.5.32-1 will be installed  
 → Processing Dependency: MariaDB-compat for package: MariaDB-common-5.5.32-1.x 86\_64  
—\> Package perl-DBI.x86\_64 0:1.609-4.el6 will be installed  
 → Running transaction check  
—\> Package MariaDB-compat.x86\_64 0:5.5.32-1 will be obsoleting  
—\> Package mysql-libs.x86\_64 0:5.1.69-1.el6\_4 will be obsoleted  
 → Finished Dependency Resolution

Dependencies Resolved

# ================================================================================ Package Arch Version Repository Size

Installing:  
MariaDB-client x86\_64 5.5.32-1 mriadb 10 M  
MariaDB-compat x86\_64 5.5.32-1 mriadb 2.7 M  
replacing mysql-libs.x86\_64 5.1.69-1.el6\_4  
MariaDB-server x86\_64 5.5.32-1 mriadb 34 M  
Installing for dependencies:  
MariaDB-common x86\_64 5.5.32-1 mriadb 23 k  
perl-DBI x86\_64 1.609-4.el6 base 705 k

# Transaction Summary

Install 5 Package(s)

## Total download size: 47 M Downloading Packages: (1/5): MariaDB-5.5.32-centos6-x86\_64-client.rpm | 10 MB 00:01 (2/5): MariaDB-5.5.32-centos6-x86\_64-common.rpm | 23 kB 00:00 (3/5): MariaDB-5.5.32-centos6-x86\_64-compat.rpm | 2.7 MB 00:00 (4/5): MariaDB-5.5.32-centos6-x86\_64-server.rpm | 34 MB 00:03 (5/5): perl-DBI-1.609-4.el6.x86\_64.rpm | 705 kB 00:00

Total 9.6 MB/s | 47 MB 00:04  
warning: rpmts\_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY  
Retrieving key from [https://yum.mariadb.org/RPM-GPG-KEY-MariaDB](https://yum.mariadb.org/RPM-GPG-KEY-MariaDB)  
Importing GPG key 0x1BB943DB:  
Userid: “Daniel Bartholomew (Monty Program signing key) [dbart@askmonty.org](mailto:dbart@askmonty.org)”  
From : [https://yum.mariadb.org/RPM-GPG-KEY-MariaDB](https://yum.mariadb.org/RPM-GPG-KEY-MariaDB)  
Running rpm\_check\_debug  
Running Transaction Test  
Transaction Test Succeeded  
Running Transaction  
Installing : MariaDB-compat-5.5.32-1.x86\_64 1/6  
Installing : MariaDB-common-5.5.32-1.x86\_64 2/6  
Installing : perl-DBI-1.609-4.el6.x86\_64 3/6  
Installing : MariaDB-server-5.5.32-1.x86\_64 4/6  
chown: cannot access `/var/lib/mysql’: No such file or directory

PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !  
To do so, start the server, then issue the following commands:

‘/usr/bin/mysqladmin’ -u root password ‘new-password’  
‘/usr/bin/mysqladmin’ -u root -h [ossez.com.ossez.com](http://ossez.com.ossez.com) password ‘new-password’

Alternatively you can run:  
‘/usr/bin/mysql\_secure\_installation’

which will also give you the option of removing the test  
databases and anonymous user created by default. This is  
strongly recommended for production servers.

See the MariaDB Knowledgebase at [http://kb.askmonty.org](http://kb.askmonty.org) or the  
MySQL manual for more instructions.

Please report any problems with the ‘/usr/bin/mysqlbug’ script!

The latest information about MariaDB is available at [http://mariadb.org/](http://mariadb.org/).  
You can find additional information about the MySQL part at:  
[http://dev.mysql.com](http://dev.mysql.com)  
Support MariaDB development by buying support/new features from  
Monty Program Ab. You can contact us about this at [sales@montyprogram.com](mailto:sales@montyprogram.com).  
Alternatively consider joining our community based development effort:  
[Contributing to the MariaDB Project | General Resources | MariaDB Documentation](http://kb.askmonty.org/en/contributing-to-the-mariadb-project/)

Installing : MariaDB-client-5.5.32-1.x86\_64 5/6  
Erasing : mysql-libs-5.1.69-1.el6\_4.x86\_64 6/6  
Verifying : MariaDB-common-5.5.32-1.x86\_64 1/6  
Verifying : MariaDB-server-5.5.32-1.x86\_64 2/6  
Verifying : perl-DBI-1.609-4.el6.x86\_64 3/6  
Verifying : MariaDB-client-5.5.32-1.x86\_64 4/6  
Verifying : MariaDB-compat-5.5.32-1.x86\_64 5/6  
Verifying : mysql-libs-5.1.69-1.el6\_4.x86\_64 6/6

Installed:  
MariaDB-client.x86\_64 0:5.5.32-1 MariaDB-compat.x86\_64 0:5.5.32-1  
MariaDB-server.x86\_64 0:5.5.32-1

Dependency Installed:  
MariaDB-common.x86\_64 0:5.5.32-1 perl-DBI.x86\_64 0:1.609-4.el6

Replaced:  
mysql-libs.x86\_64 0:5.1.69-1.el6\_4

Complete!  
[root@ossez ~]#  
[/code]
