12

mysql does not exist anymore but when i run yum remove mysql it says that the package is available but not marked for installation, i cannot install new mysql because of that, I need to completely delete everything related to it before installing new one, i do not have tables created so don't need to backup anything i tried to use the yum plugin yum-remove-with-leaves didn't work and didn't find any guide to install it properly, anyway i read on forums that it's buggy and should not be installed so I'm searching for other ways to remove mysql completely

and can i do it using sftp?

@quanta

the output of rpm -qa | grep mysql is

mysql55-libs-5.5.10-1.w5
libmysqlclientl5-5.0.77-1.1.w5
php-mysql-5.3.8-1.1.w5

EDIT

I tried

yum remove mysql
yum remove mysql-server
yum clean all

and it doesn't seem to fix it.

When I run yum install mysql mysql-server or yum install mysql or yum install install mysql-server i would get this

enter image description here

user
  • 849
  • 3
  • 13
  • 18

8 Answers8

17
  1. Execute the following command :

    # rpm -qa | grep mysql
    

    It will list all installed mysql packages on your system. Eg: mysql-libs-5.1.73-3.el6_5.x86_64

  2. now execute the command:

    # yum remove <name displayed in above step-1>
    

    Eg: yum remove mysql-libs-5.1.73-3.el6_5.x86_64

Sumedh J
  • 171
  • 1
  • 2
9

yum remove mysql55-libs and try again.

Besides, I saw you used a lot of repos: atomic, dag, epel, rpmforge, livna, ..., it may be the cause of conflicting. In my opinion, atomic and (rpmforge or epel) are enough.

quanta
  • 51,413
  • 19
  • 159
  • 217
  • 1
    ok how to remove the repos that i don't need, 'yum remove dog' or is there another way? – user Sep 05 '11 at 10:39
  • 1
    Open the `/etc/yum.repos.d/*.repo` file and change `enabled=1` to `enabled=0`. – quanta Sep 05 '11 at 10:45
  • didn't work, i got a new vps and it's working now, i guess there was something wrong with the server, thanks for your time sir – user Sep 06 '11 at 21:04
2

Try this:

    yum clean all
    yum install mysql
Bart De Vos
  • 17,911
  • 6
  • 63
  • 82
Richardp
  • 184
  • 1
  • 2
  • 14
2

you may have somehow installed mariadb when you thought it was installing mysql.

[root@localhost data_decrypt]# rpm -qa | grep maria
mariadb-server-5.5.52-1.el7.x86_64
mariadb-libs-5.5.52-1.el7.x86_64
mariadb-devel-5.5.52-1.el7.x86_64
mariadb-5.5.52-1.el7.x86_64
davidj411
  • 121
  • 2
1

this works like a charm on centos 7 if you are inside an air-gapped (offline) server and were installed mysql using rpm bundle

service mysqld stop
rpm -qa | grep mysql | xargs -I % sh -c 'yum remove -y %'
1

Remove the packages:

sudo yum remove $(rpm -qa | grep mysql)

Then remove mysql dir:

sudo rm -rf /var/lib/mysql/
0
yum remove mysql*

find / -name mysql

rm -rf (all folders listed in find)
kenlukas
  • 3,101
  • 2
  • 16
  • 26
-1
rm -rf `find / -name mysql*`

This will find any files with mysql and remove them. Once that is done, you should be able to re-install mysql-server.