MacLochlainns Weblog

Michael McLaughlin's Technical Blog

Site Admin

Fedora Install of MySQL

with 16 comments

I built a new image on VMWare Fusion for my class, which required installing MySQL 5.6 on Fedora, Version 20. If you don’t know how to add your user to the sudoers list, you should check this older and recently updated blog post.

  1. Download the MySQL Yum Repository and launch the downloaded RPM.
  1. Install MySQL on Fedora, Version 20, which you can find with the following command:
shell> rpm -qa | grep mysql

The fc20-5 changes with point releases, but assuming that you’re installing the fc20-5 release:

shell> sudo yum localinstall mysql-community-release-fc20-5.noarch.rpm
  1. Install MySQL on Fedora with the following command:
shell> sudo yum install mysql-server
  1. Start the MySQL service on Fedora with the following command:
shell> sudo service mysqld start
  1. Secure the MySQL installation with the following command:
shell> mysql_secure_installation
  1. Set the MySQL Service to start with the Fedora operating system with the following command (not chkconfig):
shell> sudo systemctl enable mysqld.service

It sets the following two links:

ln -s '/usr/lib/systemd/system/mysqld.service' '/etc/systemd/system/mysql.service'
ln -s '/usr/lib/systemd/system/mysqld.service' '/etc/systemd/system/'

Restart the Fedora operating system to effect the changes.

  1. Reset the MySQL configuration file to enable external connections through Port 3306 with the following changes to the my:

Remark out the socket line, like this:


Add the bind-address and port lines below after you know the actual IP address of the server to the my.cnf file in the /etc directory.

You substitute the actual IP address for the nnn.nnn.nnn.nnn on the bind_address line with the actual IP address returned by the ifconfig command, like this:

shell> ifconfig

Then, add these two lines to the my.cnf file.


It’s actually easier to use localhost.localdomain than an IP address when you use DHCP, like:


If you plan to connect from a host system, like Windows or Mac OS X, to a virtual Linux environment using DHCP, change localhost.localdomain to

  1. Restart the mysqld service with the following syntax:
shell> sudo service mysqld restart

You can check whether MySQL is listening on Port 3306 with this syntax:

shell> sudo netstat –anp | grep 3306

It displays:

tcp        0      0*               LISTEN      1311/mysqld

Go to this page if you want to install MySQL Workbench.

Written by maclochlainn

January 7th, 2014 at 11:04 pm

Posted in Fedora,Linux,MySQL,VMWare

Tagged with , ,

16 Responses to 'Fedora Install of MySQL'

Subscribe to comments with RSS or TrackBack to 'Fedora Install of MySQL'.

  1. I am getting this error when installing mysql-server package.

    Downloading packages:

    mysql-community-server-5.6.15-1.fc20.x86_64.rpm                                                                                |  56 MB  00:01:19     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
    error: %pre(mysql-community-server-5.6.15-1.fc20.x86_64) scriptlet failed, exit status 127
    Error in PREIN scriptlet in rpm package mysql-community-server-5.6.15-1.fc20.x86_64


    16 Jan 14 at 3:30 pm

  2. Rodrigo, Are you on the 64-bit version of Fedora? Please run this command:

    sudo uname -a

    It should returns something like:

    Linux localhost.localdomain 3.12.6-300.fc20.x86_64 #1 SMP Mon Dec 23 16:44:31 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux


    17 Jan 14 at 12:41 am

  3. […] MySQL Workbench 6.0 isn’t available for Fedora, Version 20 […]

  4. I had the same problem with the 32-bit version, like this:

    Total download size: 55 M
    Installed size: 216 M
    Downloading packages:
    mysql-community-server-5.6.15-1.fc20.i686.rpm              |  55 MB   02:21     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
    error: %pre(mysql-community-server-5.6.15-1.fc20.i686) scriptlet failed, exit status 127
    Error in PREIN scriptlet in rpm package mysql-community-server-5.6.15-1.fc20.i686
      Verifying  : mysql-community-server-5.6.15-1.fc20.i686                    1/1 
      mysql-community-server.i686 0:5.6.15-1.fc20                                   

    How does one diagnose this?


    21 Jan 14 at 11:45 am

  5. Reynold,

    Check this post from the Percona web site. It appears similar?



    21 Jan 14 at 11:53 am

  6. Good article but one modification:

    On Fc20, the default “mysql” database is mariaDb, so the service need to be enabled like:

    # systemctl enable mariadb.service

    Joao Neto

    26 Feb 14 at 7:49 am

  7. Joao, but the post was showing my students how to start MySQL. 😉 That’s a great add though. Thanks. Michael


    27 Feb 14 at 1:50 am

  8. I am getting the below error on executing sudo yum install mysql-server

    Error downloading packages:
    mysql-community-libs-5.6.19-1.fc20.x86_64: [Errno 256] No more mirrors to try.


    18 Jun 14 at 12:46 am

  9. Paul, That appears to be a network connectivity issue, but I’ll try to test it next week.


    18 Jun 14 at 10:45 am

  10. […] follow my earlier instructions for installing MySQL on Fedora […]

  11. […] follow my earlier instructions for installing MySQL on Fedora 20 […]

  12. Please help :
    After installing Fedora 11 I get Makefile Error ” d:1: *** multiple target patterns. Stop.”


    8 Oct 14 at 4:35 pm

  13. Ana, Can you give met the whole error message? Thanks.


    14 Oct 14 at 12:06 pm

  14. […] builds on my Fedora Install of MySQL post […]

  15. […] post builds on my Fedora Installations of MySQL and MySQL Workbench on Fedora posts from last year. It also presumes that you’ve installed a […]

  16. […] They got stuck because they had the following setting in their my.cnf file […]

Leave a Reply