Centos7 下mariadb安装

  1、创建 /etc/yum.repos.d/MariaDB.repo

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

添加如下内容:

[mariadb]
name=MariaDB
baseurl=http://mirrors.ustc.edu.cn/mariadb/yum/10.3/centos7-amd64/
gpgkey=http://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

2、运行命令安装:yum -y install MariaDB-server MariaDB-client

3、启动Mariadb服务

systemctl start mariadb #启动服务
systemctl enable mariadb #设置开机启动
systemctl restart mariadb #重新启动
systemctl stop mariadb.service #停止MariaDB

4、 修改密码

mysqladmin -u root password '123456'

5、登陆到mysql服务器 mysql -u root

登陆后,执行:

然后再用客户端来连接登陆

猜你喜欢

转载自www.cnblogs.com/yinfengjiujian/p/9194682.html