beyondworld translated

This commit is contained in:
lixiang23 2017-03-16 09:10:02 +08:00
parent de0eb9839c
commit 51951e9134

View File

@ -1,29 +1,26 @@
beyondworld translating
如何在CentOS 7上安装和安全配置MariaDB 10
===========================================
How to Install and Secure MariaDB 10 in CentOS 7
============================================================
MariaDB是MySQL数据库的免费开源分支与MySQL在思想上同出一源在未来仍将是免费且开源的。
在这篇博文中我将会介绍如何在当前使用最广的RHEL/CentOS和Fedora发行版上安装MariaDB 10.1稳定版。
MariaDB is a free and open source fork of well known MySQL database management server software, developed by the brains behind MySQL, its envisioned to remain free/open source.
目前了解到的情况是Red Hat Enterprise Linux/CentOS 7.0发行版已将默认的数据库从MySQL切换到MariaDB。
In this tutorial, we will show you how to install MariaDB 10.1 stable version in the most widely used versions of RHEL/CentOS and Fedora distributions.
在本文中需要注意的是我们假定您能够在服务器中使用root帐号工作或者可以使用[sudo command][7]运行任何命令。
For your information, Red Hat Enterprise Linux/CentOS 7.0 switched from supporting MySQL to MariaDB as the default database management system.
### 第一步添加MariaDB的yum仓库
Note that in this tutorial, well assume your working on the server as root, otherwise, use the [sudo command][7] to run all the commands.
### Step 1: Add MariaDB Yum Repository
1. Start by adding the MariaDB YUM repository file `MariaDB.repo` for RHEL/CentOS and Fedora systems.
1、首先在RHEL/CentOS和Fedora操作系统中添加MariaDB的YUM配置文件'MariaDB.repo'文件。
```
# vi /etc/yum.repos.d/MariaDB.repo
```
Now add the following lines to your respective Linux distribution version as shown.
根据您操作系统版本选择下面的相应内容添加到文件的末尾。
#### On CentOS 7
#### 在CentOS 7中安装
```
[mariadb]
@ -33,7 +30,7 @@ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
```
#### On RHEL 7
#### 在RHEL 7中安装
```
[mariadb]
@ -46,11 +43,11 @@ gpgcheck=1
![Add MariaDB Yum Repo](http://www.tecmint.com/wp-content/uploads/2017/02/Add-MariaDB-Repo.png)
][8]
Add MariaDB Yum Repo
添加MariaDB YUM仓库
### Step 2: Install MariaDB in CentOS 7
### 第二步在CentOS 7中安装MariaDB
2. Once MariaDB repository has been added, you can easily install it with just one single command.
2、当MariaDB仓库地址添加好后你可以通过下面的一行命令轻松安装MariaDB。
```
# yum install MariaDB-server MariaDB-client -y
@ -59,9 +56,9 @@ Add MariaDB Yum Repo
![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/02/Install-MariaDB-in-CentOS-7.png)
][9]
Install MariaDB in CentOS 7
在CentOS 7中安装MariaDB
3. As soon as the installation of MariaDB packages completes, start the database server daemon for the time being, and also enable it to start automatically at the next boot like so:
3. 一旦MariaDB包安装完毕可以手动启动数据库服务守护进程并可以通过下面的操作设置在操作系统重启后自动启动服务。
```
# systemctl start mariadb
@ -72,11 +69,11 @@ Install MariaDB in CentOS 7
![Start MariaDB Service in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/02/Start-MariaDB-Service-in-CentOS-7.png)
][10]
Start MariaDB Service in CentOS 7
在CentOS 7中启动MariaDB服务
### Step 3: Secure MariaDB in CentOS 7
### 第三步在CentOS 7中对MariaDB进行安全配置
4. Now its time to secure your MariaDB by setting root password, disabling remote root login, removing the test database as well as anonymous users and finally reload privileges as shown in the screen shot below:
4. 现在可以通过以下操作进行安全配置设置MariaDB的root账户密码禁用root远程登录删除测试数据库以及测试帐号最后需要使用下面的命令重新加载权限。
```
# mysql_secure_installation
@ -85,9 +82,9 @@ Start MariaDB Service in CentOS 7
![Secure MySQL in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/02/Secure-MySQL-in-CentOS-7.png)
][11]
Secure MySQL in CentOS 7
CentOS 7中的MySQL安全配置
5. After securing the database server, you may want to check certain MariaDB features such as: installed version, default program argument list, and also login to the MariaDB command shell as follows:
5. 在配置完数据库的安全配置后你可能想检查下MariaDB的特性比如版本号默认参数列表以及通过MariaDB命令行登录。如下所示
```
# mysql -V
@ -98,36 +95,35 @@ Secure MySQL in CentOS 7
![Verify MySQL Version](http://www.tecmint.com/wp-content/uploads/2017/02/Verify-MySQL-Version.png)
][12]
Verify MySQL Version
检查MySQL版本信息
### Step 4: Learn MariaDB Administration
### 第四步学习MariaDB管理
If you are new to MySQL/MariaDB, start off by going through these guides:
如果你刚开始学习使用MySQL/MariaDB可以通过以下指南学习
1. [Learn MySQL / MariaDB for Beginners Part 1][1]
2. [Learn MySQL / MariaDB for Beginners Part 2][2]
3. [MySQL Basic Database Administration Commands Part III][3]
4. [20 MySQL (Mysqladmin) Commands for Database Administration Part IV][4]
Also check out these following articles to fine tune your MySQL/MariaDB performance and use the tools to monitor the activity of your databases.
同样查看下面的文档学习如何优化你的MySQL/MariaDB服务并使用工具监控数据库的活动情况。
1. [15 Tips to Tune and Optimize Your MySQL/MariaDB Performance][5]
2. [4 Useful Tools to Monitor MySQL/MariaDB Database Activities][6]
Thats it for now! In this simple tutorial, we showed you how to install MariaDB 10.1 stable version in various RHEL/CentOS and Fedora. Use the feedback form below to send us any questions or any thoughts concerning this guide.
文章到此就结束了本文内容比较浅显文中主要展示了如何在RHEL/CentOS和Fefora操作系统中安装MariaDB 10.1稳定版。您可以通过下面的联系方式将您遇到的任何问题或者想法发给我们。
--------------------------------------------------------------------------------
作者简介:
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.
Aaron Kill是Linux和开源软件的狂热爱好者即将成为一名Linux系统管理员和网站开发工程师现在是TecMint的内容编辑喜欢使用电脑工作并且热衷分享知识。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-mariadb-in-centos-7/
作者:[Aaron Kili][a]
译者:[译者ID](https://github.com/译者ID)
译者:[beyondworld](https://github.com/beyondworld)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出