Centos8安装MariaDB10.5(采用国内镜像)
新建配置文件:MariaDB.repo
vim /etc/yum.repos.d/MariaDB.repo
写入如下内容
# MariaDB 10.5 CentOS repository list - created 2020-10-23 01:54 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = https://mirrors.aliyun.com/mariadb/yum/10.5/centos8-amd64/
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
执行命令,开始安装
sudo dnf install MariaDB-server
开启服务
sudo systemctl start mariadb
开机启动
systemctl enable mariadb
初始化
mysql_secure_installation
Enter current password for root (enter for none): //输入root(mysql)的密码。默认没有,直接回车
Switch to unix_socket authentication [Y/n] //是否切换到unix套接字身份验证[Y/n] n
Set root password? [Y/n] –>是否设置root用户密码,输入y并回车或直接回车
New password: –>设置root用户的密码
Re-enter new password: –>再输入一次你设置的密码
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完成后,以mysql的root身份登录
mysql -uroot -p