【centos 7】centos 7系统安装配置MariaDB数据库

更新时间:2019-11-10    来源:CentOS    手机版     字体:

【www.bbyears.com--CentOS】


步骤1:下载并安装MariaDB

安装从库 MariaDB是作为CentOS 7在CentOS回购运。任何较低的需要要求你添加额外的存储库服务器。运行以下命令在您的服务器:

yum update -y
yum install mariadb-server

您可能还需要通过运行安装完成:

/usr/bin/mysql_secure_installation

这将安装MariaDB和步行通过你设置你的密码的过程。
从MariaDB镜安装手册(最新版本)
这应该是简单的。您将需要创建在/ etc / yum.repos.d/and文件添加如下:

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.0/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

一旦创建了这个文件,运行以下命令:

yum update -y
yum install MariaDB-server MariaDB-client

你可以通过运行安装完成:

/usr/bin/mysql_secure_installation

如果显示successful,进入下一步。
步骤2:验证MariaDB是操作
如果你如果你使用一个自定义的ISO使用CentOS 7,您可能需要手动启动MariaDB和使它开始在服务器启动。这样做,运行:

systemctl start mariadb.service
systemctl enable mariadb.service

你可以检查看看是否一切都是通过执行以下命令运行:

systemctl is-active mariadb.service

安装后,运行mysql -u root -p输入你的密码。你会看到类似下面的输出:

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is XXXX
Server version: 5.5.X
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type "help;" or "\h" for help. Type "\c" to clear the current input statement.
MariaDB [(none)]>

祝贺你,你已经成功在CentOS 7上安装完mariadb了。如果你得到一个错误有关的连接,请确保mariadb是运行的并重复第二个步骤

本文来源:http://www.bbyears.com/caozuoxitong/78428.html

热门标签

更多>>

本类排行