Centos 7 | 安装最新MariaDB

文章目录

配置源

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

将baseurl=后的地址部分改成清华源,例如:

http://yum.mariadb.org

换为

https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum
  • 以10.3为例
[mariadb]
name = MariaDB
baseurl = https://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

安装

yum -y install MariaDB-server MariaDB-client
  • 启动mariadb,设置开机启动mariadb
systemctl enable mariadb
systemctl start mariadb
  • 首次安装需要进行数据库的配置
mysql_secure_installation

进行MariaDB的相关简单配置
mysql_secure_installation
(1)首先是设置密码,会提示先输入密码.。
Enter current password for root (enter for none):<–初次运行直接回车
(2)设置密码
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码
(3)其他配置
Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车,
Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车
初始化MariaDB完成,

猜你喜欢

转载自blog.csdn.net/stone_fall/article/details/106739628