在CentOS 7中安装MariaDB

部署环境

OS: CentOS Linux 7 X64

MariaDB 

首先打开MariaDB官网,点击【Download MariaDB Now!】 按钮进入下载页面

在CentOS 7中安装MariaDB_第1张图片

选择要安装的版本后点击【Download 10.0.20 Stable Now!】进入下载文件列表

在CentOS 7中安装MariaDB_第2张图片

点击【Repository Configuration Tool】查看源配置,依次选择,如下图

在CentOS 7中安装MariaDB_第3张图片


打开终端,在root权限下输入

# cd /etc/yum.repos.d/
# vi MariaDB-Repo.repo

在MariaDB-Repo.repo文件中输入

# MariaDB 10.0 CentOS repository list - created 2015-07-06 05:51 UTC# http://mariadb.org/mariadb/repositories/[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDBgpgcheck=1

保存退出

使用

sudo yum install MariaDB-server MariaDB-client

进行安装,下面是安装概要

依赖关系解决

================================================================================
 Package                    架构      版本                     源          大小
================================================================================
正在安装:
 MariaDB-client             x86_64    10.0.20-1.el7.centos     mariadb     10 M
 MariaDB-server             x86_64    10.0.20-1.el7.centos     mariadb     54 M
 MariaDB-shared             x86_64    10.0.20-1.el7.centos     mariadb    1.2 M
      替换  mariadb-libs.x86_64 1:5.5.41-2.el7_0
为依赖而安装:
 MariaDB-common             x86_64    10.0.20-1.el7.centos     mariadb     43 k
 perl-Compress-Raw-Bzip2    x86_64    2.061-3.el7              base        32 k
 perl-Compress-Raw-Zlib     x86_64    1:2.061-4.el7            base        57 k
 perl-DBI                   x86_64    1.627-4.el7              base       802 k
 perl-Data-Dumper           x86_64    2.145-3.el7              base        47 k
 perl-IO-Compress           noarch    2.061-2.el7              base       260 k
 perl-Net-Daemon            noarch    0.48-5.el7               base        51 k
 perl-PlRPC                 noarch    0.2020-14.el7            base        36 k

事务概要
================================================================================
安装  3 软件包 (+8 依赖软件包)

总下载量:67 M
Is this ok [y/d/N]:

输入 y 确认安装,安装时长取决于你的网络状况和主机配置

查看数据状态,启动数据库

# service mysql status
 ERROR! MySQL is not running

提示数据库没有运行,键入命令

# service mysql start 
Starting MySQL. SUCCESS!

启动数据库

修改root密码

# mysqladmin -u root password 'admin2015'

登陆MySQL

# mysql -u root -p 
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 10.0.20-MariaDB MariaDB Server

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

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

MariaDB [(none)]>

远程登陆








你可能感兴趣的:(在CentOS 7中安装MariaDB)