centos6.9安装mariadb失败及解决办法

Posted sunan

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos6.9安装mariadb失败及解决办法相关的知识,希望对你有一定的参考价值。

yum install MariaDB-server MariaDB-client

提示:mysql-server-5.1.73-8.el6_8.x86_64 was supposed to be removed but is not!

因为安装操作系统的时候,mysql也一块安装了,但安装MariaDB并不能卸载此前安装的mysql,导致MariaDB安装失败。

1、首先查找出安装的mysql包

    [[email protected] ~]# rpm -qa | grep -i ‘^mysql-‘
    mysql-server-5.1.73-8.el6_8.x86_64

2、如果mysql在开启,首先关闭

    [[email protected] ~]# /etc/init.d/mysqld stop
    Stopping mysqld:                                           [  OK  ]

3、卸载安装的mysql包

    [[email protected] ~]# rpm --nodeps -ev mysql-server-5.1.73-8.el6_8.x86_64

4、查看是否卸载了mysql

    [[email protected] ~]# rpm -qa | grep -i ‘^mysql-‘

    没有显示即没有和mysql相关的包,已经卸载。

5、重新执行MariaDB安装

    yum install MariaDB-server MariaDB-client

6、查看安装MariaDB生成的文件

    [[email protected] ~]# rpm -ql MariaDB-server

    /etc/init.d/mysql
    /etc/logrotate.d/mysql
    /etc/my.cnf.d
    /etc/my.cnf.d/server.cnf
    ....

7、启动服务

    [[email protected] ~]# /etc/init.d/mysql start
    Starting MySQL.180120 16:22:20 mysqld_safe Logging to ‘/var/lib/mysql/centos6_103.sunan.err‘.
    180120 16:22:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    ...                                                        [  OK  ]
    [[email protected] ~]# ss -ntl
    State      Recv-Q Send-Q                  Local Address:Port                    Peer Address:Port
    LISTEN     0      50                                  *:3306                               *:*     
    LISTEN     0      128                                 *:57007                              *:*     
    LISTEN     0      128                                :::111                               :::*

    看到3306端口已经开启

8、查看安装的版本

    [[email protected] ~]# mysql --version  
    mysql  Ver 15.1 Distrib 5.5.59-MariaDB, for Linux (x86_64) using readline 5.1

 
















以上是关于centos6.9安装mariadb失败及解决办法的主要内容,如果未能解决你的问题,请参考以下文章

Centos6.9部署ORTS5.0.22

CentOS6.9-zabbix3.2启动失败原因及页面没有mysql选择项

CentOS7安装vncserver(启动失败及连接黑屏解决办法)

编译安装 mariadb

Visual Assist X 安装失败解决办法

Unity(新机)安装失败解决办法