在CentOS 6上安装MariaDB 10

在撰写本文时,MariaDB 10.1是MariaDB的开发版本。它基于MariaDB 5.5,并包含MySQL 5.6的反向移植功能。还有一些MariaDB独有的新功能。

对于CentOS,RedHat和Fedora,强烈建议使用yum从存储库安装。本指南将引导您完成CentOS 6的安装步骤。

添加MariaDB存储库

首先,在安装之前,请确保可用软件包的列表是最新的。打开SSH终端并输入以下命令。

yum -y update

添加MariaDB存储库。

nano /etc/yum.repos.d/MariaDB.repo

对于32位用户,请粘贴以下文本:

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-x86
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

对于64位用户,请粘贴以下文本:

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

保存MariaDB.repo文件。

安装软件

此时,安装MariaDB就像只运行一个命令一样简单。

yum install MariaDB-server MariaDB-client -y

安装完成后,启动MariaDB。

service mysql start

接下来,将MariaDB设置为在每次引导时启动。

chkconfig mysql on

安全的MariaDB

保护您的MariaDB安装。以下清单显示了将要执行的步骤。

  • 设置(更改)根密码。
  • 删除匿名用户。
  • 禁止远程root登录。
  • 删除测试数据库并访问它。
  • 重新加载特权表。

运行安全安装命令。

mysql_secure_installation

输出示例

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: ENTER YOUR PASSWORD
Re-enter new password: REPEAT YOUR PASSWORD
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
 installation should now be secure.

Thanks for using MariaDB!

重新启动MariaDB。

service mysql restart

您可以使用以下命令连接到MariaDB。

mysql -u root -p

恭喜,您已在CentOS 6上成功安装了MariaDB。

留下評論

在Arch Linux上使用Makepkg

在Arch Linux上使用Makepkg

在Arch Linux上使用Makepkg可以避免系统污染,确保仅安装必要的依赖关系。

如何在Ubuntu 16.04上安装OpenSIPS控制面板

如何在Ubuntu 16.04上安装OpenSIPS控制面板

快速学习如何在Ubuntu 16.04上安装OpenSIPS控制面板,为VoIP提供商提供支持的功能。

在Fedora 28上安装Akaunting

在Fedora 28上安装Akaunting

学习如何在Fedora 28上安装Akaunting,一款适合小型企业和自由职业者的开源会计软件。

如何在CentOS 7上安装Mailtrain新闻通讯应用程序

如何在CentOS 7上安装Mailtrain新闻通讯应用程序

使用其他系统?Mailtrain是一个基于Node.js和MySQL / MariaDB构建的开源自托管新闻通讯应用程序。

诊断Minecraft服务器延迟和低TPS

诊断Minecraft服务器延迟和低TPS

了解導致Minecraft延遲的原因和解決方案,包括優化伺服器性能和減少滯後的步驟。

AI 能否應對越來越多的勒索軟件攻擊?

AI 能否應對越來越多的勒索軟件攻擊?

勒索軟件攻擊呈上升趨勢,但人工智能能否幫助應對最新的計算機病毒?AI 是答案嗎?在這裡閱讀知道是 AI 布恩還是禍根

ReactOS:這是 Windows 的未來嗎?

ReactOS:這是 Windows 的未來嗎?

ReactOS,一個開源和免費的操作系統,這裡有最新版本。它能否滿足現代 Windows 用戶的需求並打倒微軟?讓我們更多地了解這種老式但更新的操作系統體驗。

通過 WhatsApp 桌面應用程序 24*7 保持聯繫

通過 WhatsApp 桌面應用程序 24*7 保持聯繫

Whatsapp 終於為 Mac 和 Windows 用戶推出了桌面應用程序。現在您可以輕鬆地從 Windows 或 Mac 訪問 Whatsapp。適用於 Windows 8+ 和 Mac OS 10.9+

人工智能如何將流程自動化提升到新的水平?

人工智能如何將流程自動化提升到新的水平?

閱讀本文以了解人工智能如何在小型公司中變得流行,以及它如何增加使它們成長並為競爭對手提供優勢的可能性。

macOS Catalina 10.15.4 補充更新引發的問題多於解決

macOS Catalina 10.15.4 補充更新引發的問題多於解決

最近,Apple 發布了 macOS Catalina 10.15.4 補充更新以修復問題,但似乎該更新引起了更多問題,導致 mac 機器變磚。閱讀這篇文章以了解更多信息