如何部署Oracle Linux 9.x MariaDB?
- By : Will
- Category : MySQL & MariaDB

MySQL & MariaDB
1 基础知识
– MariaDB数据库管理系统是MySQL的一个分支
– MariaDB主要由开源社区在维护,采用GPL授权许可
– MariaDB的目的是完全兼容MySQL,包括API和命令行
– MariaDB能轻松成为MySQL的代替品
2 最佳实践
2.1 系统环境
2.1.1 环境信息
OS = Oracle Linux 9.x x86_64
IP Address = any
hostname = any
2.1.2 防火墙配置(可选)
firewall-cmd --permanent --add-service mysql firewall-cmd --reload firewall-cmd --list-all
2.2 部署软件包
dnf install -y mariadb-server
以上使用系统默认源安装,如果你需要安装其他版本,请参考以下链接选择官方源,
http://yum.mariadb.org/
http://mirrors.ustc.edu.cn/mariadb/yum/
2.3 配置软件
2.3.1 启动服务并配置服务自动启动
systemctl start mariadb.service systemctl enable mariadb.service
2.3.2 初始化数据库
mysql_secure_installation
向导如下:
#... Enter current password for root (enter for none): #... Switch to unix_socket authentication [Y/n] n #... Change the root password? [Y/n] y New password: ****** Re-enter new password: ****** #... Remove anonymous users? [Y/n] y #... Disallow root login remotely? [Y/n] n #... Remove test database and access to it? [Y/n] y #... Reload privilege tables now? [Y/n] y #...
2.3.4 测试登录
mysql -uroot -p
2.3.3 基本的使用
基本的使用请参阅如下链接,
https://www.cmdschool.org/archives/1313
没有评论