2

I've installed centos7 recently, but, when I am trying to install MySQL using the command:

yum install mysql-community-server

I keep getting Exiting on user cancel while I am not hitting any keyboard button. Here is the output:

install  2 Packages (+9 Dependent packages)
 Total size: 80 M Total download size: 79 M Is this ok [y/d/N]: y 
    Downloading packages: 
    No Presto metadata available for base No Presto metadata available for mysql56-community mysql-community-client-5.6.24-3.el7.x86_64.rpm |7.6 MB     00:32 ...  mysql-community-server-5.6.24-3.el7.x86_64.rpm        |  46MB     00:41 ...  mysql-community-libs-5.6.24-3.el7.x86_64.rpm      |    0 B     00:30 ...  (1/9): mysql-community-cli 0% [                ] 4.7 kB/s | 159 kB  283:33 ETA 

    Exiting on user cancel

What is the problem? Why I can not install it? What is the solution?

Note: My yum has the following plugins: fastmirror, axelget, langpacks.

  • Are you using VirtualBox? – serenesat May 25 '15 at 13:27
  • no, I am not using Virtualbox, I have centos7 installed beside windows7 on my laptop – Бассел Жаббор May 25 '15 at 13:44
  • Did you try that command I have written in answer? – serenesat May 26 '15 at 5:12
  • You need to use MariaDB as MySql is not used any more by redhat-like distros. See one of the answers bellow – Spirit Sep 17 '16 at 16:58
2

MariaDB is a fork of MySQL. RedHat Enterprise Linux and its derivatives have shifted to MariaDB from MySQL. So you can install mariadb-server on CentOS7 using this command yum install mariadb-server mariadb. Here is a good step by step tutorial how you can do this in p.8 Install MariaDB Database or you can use this source for that Mariadb step by step

2

Try cleaning yum:

yum clean all

Hope you have done this:

Create a new file /etc/yum.repos.d/mysql-community.repo with the desired version.

For 5.7, add the lines below:

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

For 5.6, add the lines below:

[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

(use .../el/6/... for CentOS 6)

Then try the below command:

yum install mysql-community-server
  • Are you behind a web proxy? Try adding http_caching=packages to your /etc/yum.conf and see if that helps. – Mongrel Jan 15 '16 at 14:13
0

try $sudo yum update

then if you correctly configure mirrors it will update packege db.

try install mysql once more using $sudo yum install mysql-community-server

if you don't have sudo installed then $su

and install sudo #yum install sudo

0

Do you have the relevant repo file in /etc/yum.repos.d/? It is not by default on my CentOS7 system. They've made it easy for you to install this first: Go to http://dev.mysql.com/downloads/repo/yum/ and download the file and install it "manually" with rpm. Then your yum command should work.

0

The problem is that yum gives you the wrong error because of one bug. To solve it and see the real error, you need to apply this fix I found here.

There is a bug in python-urlgrabber that is used by yum that results in the wrong error being generated. It was noticed during the el7 beta and reported but it appears not to have been fixed. The problem is that the mirror that you are connecting to is interrupting the connection and yum currently sees that as an error and terminates rather than just trying another mirror.

If you don't mind editing files that are meant to be owned by the rpm then you can fix this or at least mitigate its effects. Edit /usr/lib/python2.7/site-packages/urlgrabber/grabber.py and find line 1510 where it currently says:

python CODE: SELECT ALL elif errcode in (42, 55, 56):

and change that back to what it was before

python CODE: SELECT ALL elif errcode == 42:

0

Try this command:

sudo bash -c 'yum clean metadata && yum upgrade'

After that install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.