MariaDB 是 MySQL 的替代品。 它易于安装,提供许多速度和性能改进,并且可以轻松集成到大多数 MySQL 部署中。 MariaDB 提供了比 MySQL 更多的存储引擎,包括 Cassandra (NoSQL)、XtraDB(InnoDB 的直接替代品)和 OQGRAPH。
飞行前检查
- 这些说明用于在单个设备上安装 MariaDB Fedora 23 节点。
- 我们将以 root 身份在 Liquid Web 自我管理 Fedora 23台服务器。
- 如果您对兼容性有任何疑问,可以在以下位置找到答案: MariaDB 与 MySQL — 兼容性.
第 1 步:安装 MariaDB
与往常一样,我们将首先确保我们现有的软件包是最新的:
dnf -y update
MariaDB 可以通过一个命令安装:
dnf -y install mysql-server mysql
第 2 步:启动 MySQL/MariaDB
使用以下命令启动 MySQL(现在是 MariaDB):
systemctl start mariadb
要确保 MySQL/MariaDB 在启动时启动,请运行以下命令:
systemctl enable mariadb
这应该产生类似于以下的输出:
[[email protected] ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
您可以使用以下命令检查 MySQL/MariaDB 的状态:
systemctl status mariadb
第 3 步:使用 MySQL/MariaDB
您可以使用以下命令连接到 MySQL/MariaDB:
mysql
这应该产生类似于以下的输出:
[[email protected] ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 5
Server version: 10.0.21-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.
要退出并返回到命令提示符,只需执行以下命令:
exit