1 查看CentOS的mariadb是否已安装
[root@localhost ~]# yum list installed | grep mariadb-server
mariadb-server.x86_64 1:5.5.50-1.el7_2 @updates
2 若有安装的mariadb-server,如何卸载CentOS系统mariadb-server数据库?
输入:yum -y remove mariadb-server.x86_64 ,若有多个依赖文件则依次卸载。
当结果显示为Complete!即卸载完毕。
3 查看yum库上的mariadb-server版本信息(CentOS系统需要正常连接网络)。
输入:yum list | grep mariadb-server 或 yum -y list mariadb-server*
4 查看mariadb的依赖情况
[root@localhost ~]# yum search mariadb
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
5 使用yum安装mysql数据库
[root@localhost ~]# yum install mariadb-server -y
6 查看刚安装mysql数据库版本信息。
输入:rpm -qi mysql-server
[root@localhost ~]# rpm -qi mariadb-server
Name : mariadb-server
Epoch : 1
Version : 5.5.50
Release : 1.el7_2
Architecture: x86_64
7 启动
[root@localhost ~]# systemctl start mariadb.service
8 开机自启动mariadb
[root@localhost ~]# systemctl enable mariadb.service
9 状态
[root@localhost ~]# systemctl status mariadb.service
10 登录
[root@localhost ~]# mysql
11 登录
[root@localhost ~]# mysql -uroot -p
CentOS使用yum安装mariaDB(开源MySQL)
猜你喜欢
转载自angie.iteye.com/blog/2338154
今日推荐
周排行