Install MySQL 5.5.24 on Fedora 16/15, CentOS/Red Hat (RHEL) 6.2/5.8

MySQL LogoMySQL is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. This is guide, howto install or upgrade MySQL Community Server latest and greatest version 5.5.24 on Fedora 16/15/14/13/12, CentOS 6.2/6.1/6/5.8 and Red Hat (RHEL) 6.2/6.1/6/5.8.

Note: If you are upgrading MySQL (from earlier version), then make sure that you backup (dump and copy) your database and configs. And remember run mysql_upgrade command.

Install MySQL Database 5.5.24 on Fedora 16/15/14/13/12, CentOS 6.2/6.1/6/5.8, Red Hat (RHEL) 6.2/6.1/6/5.8

1. Change root user

su -
## OR ##
sudo -i

2. Install Remi repository

Fedora

Currently extra repos are not needed on Fedora 16.

## Remi Dependency on Fedora 15, 14, 13, 12, 11, 10, 9, 8
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm 
rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
 
## Fedora 15 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-15.rpm
 
## Fedora 14 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-14.rpm
 
## Fedora 13 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-13.rpm
 
## Fedora 12 ##
rpm -Uvh http://rpms.famillecollet.com/remi-release-12.rpm

CentOS and Red Hat (RHEL)

## Remi Dependency on CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
 
## CentOS 6 and Red Hat (RHEL) 6 ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
 
 
## Remi Dependency on CentOS 5 and Red Hat (RHEL) 5 ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
 
## CentOS 5 and Red Hat (RHEL) 5 ## 
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

3. Check Available MySQL versions

Fedora 16

yum list mysql mysql-server

Fedora 15, 14, 13, 12

yum --enablerepo=remi list mysql mysql-server

CentOS 6.2/6.1/6/5.8 and Red Hat (RHEL) 6.2/6.1/6/5.8

yum --enablerepo=remi,remi-test list mysql mysql-server

Output:

Loaded plugins: changelog, fastestmirror, presto, refresh-packagekit
...
remi                                                            | 3.0 kB     00:00     
remi/primary_db                                                 | 106 kB     00:00     
Available Packages
mysql.i686                               5.5.24-1.fc14.remi                        @remi
mysql-server.i686                        5.5.24-1.fc14.remi                        @remi

4. Update or Install MySQL 5.5.24

Fedora 16

yum install mysql mysql-server

Fedora 15, 14, 13, 12

yum --enablerepo=remi install mysql mysql-server

CentOS 6.2/6.1/6/5.8 and Red Hat (RHEL) 6.2/6.1/6/5.8

yum --enablerepo=remi,remi-test install mysql mysql-server

5. Start MySQL server and autostart MySQL on boot

Fedora 16

systemctl start mysqld.service ## use restart after update
 
systemctl enable mysqld.service

Fedora 15/14/13/12/11, CentOS 6.2/6.1/6/5.8 and Red Hat (RHEL) 6.2/6.1/6/5.8

/etc/init.d/mysqld start ## use restart after update
## OR ##
service mysqld start ## use restart after update
 
chkconfig --levels 235 mysqld on

6. MySQL Secure Installation

  • Set (Change) root password
  • Remove anonymous users
  • Disallow root login remotely
  • Remove test database and access to it
  • Reload privilege tables

Start MySQL Secure Installation with following command

/usr/bin/mysql_secure_installation

Output:

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
 
In order to log into MySQL to secure it, we\'ll need the current
password for the root user.  If you\'ve just installed MySQL, and
you haven\'t set the root password yet, the password will be blank,
so you should just press enter here.
 
Enter current password for root (enter for none): 
OK, successfully used password, moving on...
 
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
 
Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!
 
 
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
 
Remove anonymous users? [Y/n] Y
 ... Success!
 
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
 
Disallow root login remotely? [Y/n] Y
 ... Success!
 
By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
 
Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
 
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
 
Reload privilege tables now? [Y/n] Y
 ... Success!
 
Cleaning up...
 
 
 
All done!  If you\'ve completed all of the above steps, your MySQL
installation should now be secure.
 
Thanks for using MySQL!

Note: If you don’t want some reason, do a “MySQL Secure Installation” then at least it’s very important to change the root user’s password

mysqladmin -u root password [your_password_here]
 
## Example ##
mysqladmin -u root password myownsecrectpass

7. Connect to MySQL database (localhost) with password

mysql -u root -p
 
## OR ##
mysql -h localhost -u root -p

8. Create Database, Create MySQL User and Enable Remote Connections to MySQL Database

This example uses following parameters:

  • DB_NAME = webdb
  • USER_NAME = webdb_user
  • REMOTE_IP = 10.0.15.25
  • PASSWORD = password123
  • PERMISSIONS = ALL
## CREATE DATABASE ##
mysql> CREATE DATABASE webdb;
 
## CREATE USER ##
mysql> CREATE USER 'webdb_user'@'10.0.15.25' IDENTIFIED BY 'password123';
 
## GRANT PERMISSIONS ##
mysql> GRANT ALL ON webdb.* TO webdb_user@'10.0.15.25';
 
##  FLUSH PRIVILEGES, Tell the server TO reload the GRANT TABLES  ##
mysql> FLUSH PRIVILEGES;

Enable Remote Connection to MySQL Server –> Open MySQL Port (3306) on Iptables Firewall (as root user again)

1. Edit /etc/sysconfig/iptables file:

nano -w /etc/sysconfig/iptables

2. Add following line before COMMIT:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

3. Restart Iptables Firewall:

service iptables restart
## OR ##
/etc/init.d/iptables restart

4. Test remote connection:

mysql -h dbserver_name_or_ip_address -u webdb_user -p webdb
Follow If Not True Then False Updates!

167 Comments

  1. Thanks for the tutorial.

    When I run the commands to install/upgrade mysql and mysql-server, PHP 5.3 is included in the list of dependencies. Is there a reason for this? I do a lot of Drupal development, which doesn’t support PHP 5.3 at this point.

    Is there a way to upgrade mysql and not upgrade PHP?

    • Hi Erich,

      Could you post full list of dependencies, what packages is going to be installed?

      • ================================================================================================================================================================================================
         Package                                        Arch                                  Version                                                   Repository                                 Size
        ================================================================================================================================================================================================
        Updating:
         mysql-server                                   i386                                  5.5.12-1.el5.remi                                         remi                                       12 M
        Installing for dependencies:
         libXaw                                         i386                                  1.0.2-8.1                                                 base                                      324 k
         libXmu                                         i386                                  1.0.2-5                                                   base                                       62 k
         libedit                                        i386                                  20090923-3.0_1.el5.rf                                     rpmforge                                  262 k
         mysql-libs                                     i386                                  5.5.12-1.el5.remi                                         remi                                      1.1 M
         mysqlclient15                                  i386                                  5.0.67-1.el5.remi                                         remi                                      1.3 M
         t1lib                                          i386                                  5.1.2-1.el5.rf                                            rpmforge                                  362 k
        Updating for dependencies:
         mysql                                          i386                                  5.5.12-1.el5.remi                                         remi                                      7.5 M
         mysql-devel                                    i386                                  5.5.12-1.el5.remi                                         remi                                      168 k
         php                                            i386                                  5.3.6-4.el5.remi                                          remi                                      1.3 M
         php-cli                                        i386                                  5.3.6-4.el5.remi                                          remi                                      2.6 M
         php-common                                     i386                                  5.3.6-4.el5.remi                                          remi                                      970 k
         php-devel                                      i386                                  5.3.6-4.el5.remi                                          remi                                      623 k
         php-gd                                         i386                                  5.3.6-4.el5.remi                                          remi                                      205 k
         php-ldap                                       i386                                  5.3.6-4.el5.remi                                          remi                                       53 k
         php-mysql                                      i386                                  5.3.6-4.el5.remi                                          remi                                      148 k
         php-pdo                                        i386                                  5.3.6-4.el5.remi                                          remi                                      113 k
         
        Transaction Summary
        ================================================================================================================================================================================================
        Install      6 Package(s)         
        Update      11 Package(s)         
        Remove       0 Package(s)
  2. Merci Rémi pour cet article et l’accès au repos.

  3. This update doesn’t work with perl , i need perl to connect to mysql database

    • Hi Um,

      What distro and Perl version are you using?

      What error message you get when trying to connect to MySQL database?

  4. When I attempt the last step I get the following:
    # service iptables restart
    iptables: Flushing firewall rules: [ OK ]
    iptables: Setting chains to policy ACCEPT: filter [ OK ]
    iptables: Unloading modules: [ OK ]
    iptables: Applying firewall rules: iptables-restore: line 14 failed [FAILED]

    Here is the content of iptables:
    # Firewall configuration written by system-config-firewall
    # Manual customization of this file is not recommended.
    *filter
    :INPUT ACCEPT [0:0]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [0:0]
    -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
    -A INPUT -p icmp -j ACCEPT
    -A INPUT -i lo -j ACCEPT
    -A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT
    -A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
    -A INPUT -j REJECT –reject-with icmp-host-prohibited
    -A FORWARD -j REJECT –reject-with icmp-host-prohibited
    -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
    COMMIT

    Any idea what is wrong?

    • Hi WM,

      Try to change -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT row to following -A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT line.

      Something like following:

      ...
      -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
      -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
      -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
      -A INPUT -j REJECT --reject-with icmp-host-prohibited
      -A FORWARD -j REJECT --reject-with icmp-host-prohibited
      COMMIT
      • ‘service iptables save’
        is required before the ‘service iptables restart’ step;

        • Thx. Very useful !

  5. thumbs up, thanks a lot…… It worked perfectly for my Fedora 13

  6. Thanks, I was very useful!!!

  7. Hello, the tutorial works, thanks, man. I used the tutorial and any information that appears when we install the mysql.

    Look:

    “To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system

    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:

    /usr/bin/mysqladmin -u root password ‘new-password’
    /usr/bin/mysqladmin -u root -h localhost.localdomain password ‘new-password’

    Alternatively you can run:
    /usr/bin/mysql_secure_installation

    which will also give you the option of removing the test
    databases and anonymous user created by default. This is
    strongly recommended for production servers.

    See the manual for more instructions.

    You can start the MySQL daemon with:
    cd /usr ; /usr/bin/mysqld_safe &

    You can test the MySQL daemon with mysql-test-run.pl
    cd /usr/mysql-test ; perl mysql-test-run.pl

    Please report any problems with the /usr/bin/mysqlbug script!”

    ========================================================

    This was very usefull, thank you, man!

  8. I’ve got Error message file ‘/usr/share/mysql/english/errmsg.sys’ had only 480 error messages instead of 641

    It is due that I have duplicated packages (mysql.i386 and mysql.x86_64 from remi). You can list that with: yum list *.i386 –> And after that you can remove dupes: yum remove *.i386

    After restart, it does not work:
    – ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
    – Error message file ‘/usr/share/mysql/english/errmsg.sys’ had only 480 error messages,
    but it should contain at least 641 error messages.

    The mysql-server-5.1.47-1.el5.remi.x86_64.rpm does not contain the language files.

    The language files are in: mysql-libs-5.1.47-1.el5.remi.x86_64.

    The language files from the 5.0.x version remain installed and cause this error. In order to avoid this, I explicitly installed the 64 bit versions: yum –enablerepo=remi install mysql-libs mysql.x86_64 mysql-devel.x86_64 mysql-server php-mysql

    After install it, it works.

  9. mysql_secure_installation is nowhere to be found. The default initial mysql database is not created.

  10. server was not installed, that’s why the installation script was not there. Sorry!

  11. when i type to command prompt “yum –enablerepo=remi install mysql-libs mysql.x86_64 mysql-devel.x86_64 mysql-server php-mysql”

    i saw this errors:

    file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.1.53-16
    file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.1.53-1.e6
    file /usr/share/mysql/german/errmsg.sys from install of mysql-libs-5.1.53-1.e6
    file /usr/share/mysql/greek/errmsg.sys from install of mysql-libs-5.1.53-1.el6
    file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-libs-5.1.53-6
    file /usr/share/mysql/italian/errmsg.sys from install of mysql-libs-5.1.53-1.6
    file /usr/share/mysql/japanese/errmsg.sys from install of mysql-libs-5.1.53-16
    file /usr/share/mysql/korean/errmsg.sys from install of mysql-libs-5.1.53-1.e6
    file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-libs-5.1.6
    file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-libs-5.1.53-6
    file /usr/share/mysql/polish/errmsg.sys from install of mysql-libs-5.1.53-1.e6
    file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-libs-5.1.536
    file /usr/share/mysql/romanian/errmsg.sys from install of mysql-libs-5.1.53-16
    file /usr/share/mysql/russian/errmsg.sys from install of mysql-libs-5.1.53-1.6
    file /usr/share/mysql/serbian/errmsg.sys from install of mysql-libs-5.1.53-1.6
    file /usr/share/mysql/slovak/errmsg.sys from install of mysql-libs-5.1.53-1.e6
    file /usr/share/mysql/spanish/errmsg.sys from install of mysql-libs-5.1.53-1.6
    file /usr/share/mysql/swedish/errmsg.sys from install of mysql-libs-5.1.53-1.6
    file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.1.53-6

    any solutions ?

    • Hi haberler,

      What OS you are using?

      Is that the entire error message? I guess that the error message is missing something?

      Is the full error message something like?

      file /usr/share/mysql/greek/errmsg.sys from install of
      mysql-libs-5.1.53-1.el5.x86_64 conflicts with file from package
      mysql-5.0.77-4.el5.x86_64
        file /usr/share/mysql/hungarian/errmsg.sys from install of
      mysql-libs-5.1.53-1.el5.x86_64 conflicts with file from package
      mysql-5.0.77-4.el5.x86_64
      • Hi JR, I have the problem that you describe. What i need to do to solved?.
        Could you please help me with this.

        • Hi Wilder,

          Could you post output of following command:

          yum list installed |grep mysql
  12. Thank you very much!!!

  13. This works great for Centos 5.5 i386, but not for x86_64 version.

    • Hi Lucas,

      Could you tell me what’s your problem with CentOS 5.5 x86_64 version?

      I can get MySQL 5.5.8 running on CentOS 5.5 x86_64 normally.

      • Hi JR:

        I have a Centos 5.5 x86_64
        uname -a says

        Linux xxx 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:52:25 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

        The mysql not start.

        This say mysql.log


        [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 480 error messages, but it should contain at least 705 error messages.
        Check that the above file is the right version for this program!
        [Note] Plugin 'FEDERATED' is disabled. /usr/libexec/mysqld: Unknown error 1146
        [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
        InnoDB: The InnoDB memory heap is disabled
        InnoDB: Mutexes and rw_locks use GCC atomic builtins
        InnoDB: Compressed tables use zlib 1.2.3
        ....
        [ERROR] Aborting

        Regards

        • Hi again Lucas,

          Could you post output of following command:

          yum list installed |grep mysql
          • Hi JR:

            [root@mysql ~]# yum list installed |grep mysql
            compat-mysql51.x86_64 5.1.54-1.el5.remi installed
            mysql.x86_64 5.5.8-1.el5.remi installed
            mysql-connector-odbc.x86_64 3.51.26r1127-1.el5 installed
            mysql-devel.x86_64 5.5.8-1.el5.remi installed
            mysql-libs.x86_64 5.5.8-1.el5.remi installed
            mysql-server.x86_64 5.5.8-1.el5.remi installed
            mysqlclient15.x86_64 5.0.67-1.el5.remi installed
            php-mysql.x86_64 5.3.5-1.el5.remi installed

            Thanks for your help.

  14. could solve the problem with this

    yum –enablerepo=remi,remi-test install mysql-libs mysql.x86_64 mysql-devel.x86_64 mysql-server php-mysql

    Greetings

    • Hi Lucas,

      I think that could solve your problem. Please let me know is it working?

      • I used…

        # yum --enablerepo=remi install mysql.x86_64 mysql-server.x86_64
        # shutdown -r now
        # sudo /etc/init.d/mysqld start
        # /usr/bin/mysql_secure_installation

        And that worked fine for me :)

  15. Step by step on clean Fedora 14 x86_64 worked excellent… Thanks for the clear concise guide!!!

  16. Hello,
    thank you for the solution provided.
    However, it does not work on my CentOS x64, I have the same error message.

    110128 16:23:03 [ERROR] Error message file ‘/usr/share/mysql/english/errmsg.sys’ had only 480 error messages,
    but it should contain at least 705 error messages.
    Check that the above file is the right version for this program!

    My versions :
    yum list installed | grep mysql
    compat-mysql51.x86_64 5.1.54-1.el5.remi installed
    mysql.x86_64 5.5.8-1.el5.remi installed
    mysql-devel.x86_64 5.5.8-1.el5.remi installed
    mysql-libs.x86_64 5.5.8-1.el5.remi installed
    mysql-server.x86_64 5.5.8-1.el5.remi installed
    mysqlclient15.x86_64 5.0.67-1.el5.remi installed
    php-mysql.x86_64 5.3.5-1.el5.remi.1 installed

    • Hi Romain,

      Are you upgrading MySQL?

      Try run mysql_upgrade command:

      mysql_upgrade
      • No, I’m not.
        Server is new, install is new.

        • Hi again Romain,

          Then try to remove MySQL completely and then reinstall it, with following commands:

          ## Remove ##
          yum remove mysql-libs mysql mysql-devel mysql-server php-mysql 
           
          ## Install again ##
          yum --enablerepo=remi,remi-test install mysql-libs mysql.x86_64 mysql-devel.x86_64 mysql-server php-mysql
          • Hello JR,
            thanks for the reply.

            As you proposed, I removed / re-installed everything, but I always have a problem.


            Feb 2 13:23:49 aofxdmas yum: Erased: mysql-devel
            Feb 2 13:23:49 aofxdmas yum: Erased: mysql-libs
            Feb 2 13:23:52 aofxdmas yum: Erased: mysql-server
            Feb 2 13:23:52 aofxdmas yum: Erased: mysql
            Feb 2 13:23:52 aofxdmas yum: Erased: php-mysql
            Feb 2 13:26:37 aofxdmas yum: Installed: mysql-libs-5.5.8-1.el5.remi.x86_64
            Feb 2 13:26:39 aofxdmas yum: Installed: mysql-5.5.8-1.el5.remi.x86_64
            Feb 2 13:26:39 aofxdmas yum: Installed: mysql-devel-5.5.8-1.el5.remi.x86_64
            Feb 2 13:26:41 aofxdmas yum: Installed: mysql-server-5.5.8-1.el5.remi.x86_64
            Feb 2 13:26:41 aofxdmas yum: Installed: php-mysql-5.3.5-1.el5.remi.1.x86_64

            and


            110202 13:31:34 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
            110202 13:31:34 [Note] Plugin 'FEDERATED' is disabled.
            110202 13:31:34 [ERROR] Function 'archive' already exists
            110202 13:31:34 [ERROR] Couldn't load plugin named 'archive' with soname 'ha_archive.so'.
            /usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
            110202 13:31:34 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
            InnoDB: The InnoDB memory heap is disabled
            InnoDB: Mutexes and rw_locks use GCC atomic builtins
            InnoDB: Compressed tables use zlib 1.2.3
            110202 13:31:34 InnoDB: Using Linux native AIO
            110202 13:31:34 InnoDB: Initializing buffer pool, size = 128.0M
            110202 13:31:34 InnoDB: Completed initialization of buffer pool
            110202 13:31:34 InnoDB: highest supported file format is Barracuda.
            110202 13:31:35 InnoDB: 1.1.4 started; log sequence number 1595675
            110202 13:31:35 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
            110202 13:31:35 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

            Thank you !

            • Let’s try once again. :) Full error message is little bit more helpful. Looks like some problem with datadir (/var/lib/mysql), so if you are doing fresh install, then try following.

              Remove MySQL completely, remove datadir and then reinstall it, with following commands:

              ## Remove MySQL ##
              yum remove mysql-libs mysql mysql-devel mysql-server php-mysql 
               
              ## Mopy datadir to tmp or Remove completely ##
              mv /var/lib/mysql /tmp
              # OR #
              rm -rf /var/lib/mysql
               
              ## Install MySQL again ##
              yum --enablerepo=remi,remi-test install mysql-libs mysql.x86_64 mysql-devel.x86_64 mysql-server php-mysql
  17. That does the trick ! \o/

    Thank you for your help and your patience…

    • Wonderful to hear that you got it to work.

      You’re welcome :)

  18. JR – THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  19. Thank you so much.
    It worked for my fedora 14

  20. Hi,

    I am a beginner with Linux it was very helpful thanks a lot i Have book marked it………

    Cheers
    Ashok G
    Programmer

  21. hi JR, thanks for the great step by steps. I can’t however get the db to start clean for 64b on cent 0S 5.5. It worked fine for 32b though. Here is some info in case you have some recommendations. Please note I followed the steps above to reinstall with yum –enablerepo=remi,remi-test install mysql-libs mysql.x86_64 mysql-devel.x86_64 mysql-server php-mysql

    Thanks for your help!

    My error log has those entries

    110309 17:44:44 mysqld_safe Starting mysqld daemon with databases from /mnt/mysql
    110309 17:44:44 [ERROR] Error message file ‘/usr/share/mysql/english/errmsg.sys’ had only 472 error messages,
    but it should contain at least 706 error messages.
    Check that the above file is the right version for this program!
    110309 17:44:44 [Note] Plugin ‘FEDERATED’ is disabled.
    110309 17:44:44 InnoDB: The InnoDB memory heap is disabled
    110309 17:44:44 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    110309 17:44:44 InnoDB: Compressed tables use zlib 1.2.3
    110309 17:44:44 InnoDB: Using Linux native AIO
    110309 17:44:44 InnoDB: Initializing buffer pool, size = 128.0M
    110309 17:44:44 InnoDB: Completed initialization of buffer pool
    110309 17:44:44 InnoDB: highest supported file format is Barracuda.
    110309 17:44:44 InnoDB: Waiting for the background threads to start
    110309 17:44:45 InnoDB: 1.1.5 started; log sequence number 43648679668
    110309 17:44:45 [ERROR] Aborting

    110309 17:44:45 InnoDB: Starting shutdown…
    110309 17:44:46 InnoDB: Shutdown completed; log sequence number 43648679668
    110309 17:44:46 [Note]

  22. thank very much

    JR tips was perfect on centos 5.5

  23. Hi,

    You may overcome some problems when installing to x86_64 by ensuring no i386 packages are installed:

    yum –enablerepo=remi,remi-test install mysql mysql-server –exclude=’*.i386′

    Cheers.

  24. hi Paul, thanks a lot , I could now start the server by excluding the 386 libs. Really appreciate your skills.
    Best
    Teide

  25. It´s good !!!! good !!!
    Thank´s

  26. Great tutorial. I work with centos and get a error that the packages are not available. Are the files down or something?

  27. Thanks alot ,

  28. Hi JR!
    I have Centos 5.4 with MySQL ver 5.0.77. I have executed this command

    rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

    and then

    yum –enablerepo=remi,remi-test list mysql mysql-server

    but seems that there aren’t any upgrade for mysql: is it possible? This is output:

    ~]# yum –enablerepo=remi,remi-test list mysql mysql-server
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * addons: mirrors.prometeus.net
    * base: mirrors.prometeus.net
    * epel: mirror.switch.ch
    * extras: mirrors.prometeus.net
    * updates: mirrors.prometeus.net
    addons | 951 B 00:00
    base | 1.1 kB 00:00
    epel | 3.7 kB 00:00
    extras | 2.1 kB 00:00
    updates | 1.9 kB 00:00
    Installed Packages
    mysql.i386 5.0.77-3.el5 installed
    mysql-server.i386 5.0.77-3.el5 installed
    Available Packages
    mysql.i386 5.0.77-4.el5_6.6 updates
    mysql-server.i386 5.0.77-4.el5_6.6 updates

    Thanks for your help

    Best regards

    • Hi Prometeo,

      Did you also installed remi repository rpm with following command:

      rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

      Then try again:

      yum –enablerepo=remi,remi-test list mysql mysql-server

      Is it showing anything?

      • OK! Thank you very much!
        Now I see MySQL 5.5.13.

        Tomorow I will try to upgrade MySQL on a test server and then on production server.

        Thanks again

        Best regards

        • Nice to hear that you get it working!

          You could tell how your upgrade process went? Remember backup your dbs before upgrade :)

          • HI JR!
            Today I try on test maschine and I have this error:

            rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
            Ripristino di http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
            avvertimento: /var/tmp/rpm-xfer.my0kvN: Header V3 DSA signature: NOKEY, key ID 00f97f56
            Preparazione in corso… ########################################### [100%]
            il pacchetto remi-release-5-8.el5.remi.noarch è già installato

            [root@weblnx ~]# yum -enablerepo=remi,remi-test list mysql mysql-serverLoaded plugins: fastestmirror

            Command line error: option -e: invalid integer value: ‘nablerepo=remi,remi-test’

            Then I try on on-line machine and errors are the same.
            Could you help me please?

            Thanks in advance

            Best regards

            • Hi Prometeo,

              Some reason I have copied and pasted wrong command on my earlier post. Guide has right one…it should be:

              yum --enablerepo=remi,remi-test list mysql mysql-server

              So there should be two dash (–) before enablerepo. :)

  29. Thank you for this excellent post!

    Though, since i am using CentOS 5.6 (with a preinstalled mysql 5.0 server and DBs)
    I had one issue with:


    110309 17:44:44 mysqld_safe Starting mysqld daemon with databases from /mnt/mysql
    110309 17:44:44 [ERROR] Error message file ‘/usr/share/mysql/english/errmsg.sys’ had only 472 error messages,
    but it should contain at least 706 error messages.

    So i downloaded the MySQL-server-5.5.12-1.rhel5.x86_64.rpm from one of mysql mirror websites and extracted the file:
    MySQL-server-5.5.12-1.rhel5.x86_64.rpm/usr/share/mysql/english/errmsg.sys
    and overwrite the one on my server.

    The above, solved the issue of mysqld_safe not starting.
    then i used mysql_upgrade to upgrade the mysql 5.0 databases to mysql 5.5
    and started the service, successfully :-)

    Thank you very much!

  30. Thanks!! Saved me a TON of time!! Great documentation!

  31. Gracias,
    Me ha sido de mucha utilidad vuestro post.

    Gracias,

  32. Hello,
    i have VPS with CentOS 5.6 running MySQL 5.0x i need to upgrade to 5.2x please can someone give me the proper command..

    i really dnt know about this commands

    Thank you

  33. hello all,
    i follow the guide last i try to upgrade but it gives me a error

    mysqlcheck: Got error: 1045: Access denied for user ‘root’@'localhost’ (using password: YES) when trying to connect

    Please please help me.. with details i’m a complete nuwbee…

  34. Hello,
    ok somehow i i manage to upgrade but now when i log in to phpmyadmin i see mysql server 5.0x not 5.5 why is that..

    • Hi anthonyinit,

      Check your MySQL version on command line with following command:

      mysql --help

      It is on first line…

  35. should people now use the new remi package?

    http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm

    if on centos 6 ?

    • Hi Mathiau,

      Yes, people should use new epel-release-6-5.noarch.rpm and new remi-release-6.rpm. I updated this guide and will update all other guides too.

  36. I am trying to upgrade MySQL 5.1 to 5.5 on RHEL 5 and I am getting the following error

    rpm -i MySQL-server-5.5.16-1.rhel5.i386.rpm
    file /etc/init.d/mysql from install of MySQL-server-5.5.16-1.rhel5.i386 conflicts with file from package MySQL-server-community-5.1.50-1.rhel5.i386
    file /usr/bin/innochecksum from install of MySQL-server-5.5.16-1.rhel5.i386 conflicts with file from package MySQL-server-community-5.1.50-1.rhel5.i386
    file /usr/bin/my_print_defaults from install of MySQL-server-5.5.16-1.rhel5.i386 conflicts with file from package MySQL-server-community-5.1.50-1.rhel5.i386
    file /usr/bin/myisam_ftdump from install of MySQL-server-5.5.16-1.rhel5.i386 conflicts with file from package MySQL-server-community-5.1.50-1.rhel5.i386
    file /usr/bin/myisamchk from install of MySQL-server-5.5.16-1.rhel5.i386 conflicts with file from package MySQL-server-community-5.1.50-1.rhel5.i386

    Is this a known issue? Is there a work around available?

    Thanks

  37. I was able to install the MySQL shared library and MySQL client but got the following message when upgrading the MySQL server

    - Remove the existing MySQL packages. Usually this command will
    list the packages you should remove:
    rpm -qa | grep -i ‘^mysql-’
    - You may choose to use ‘rpm –nodeps -ev ‘ to remove
    the package which contains the mysqlclient shared library. The
    library will be reinstalled by the MySQL-shared-compat package.
    - Install the new MySQL packages supplied by Oracle and/or its affiliates
    - Ensure that the MySQL server is started
    - Run the ‘mysql_upgrade’ program
    This is a brief description of the upgrade process. Important details
    can be found in the MySQL manual, in the Upgrading section.
    ******************************************************************
    error: %pre(MySQL-server-5.5.16-1.rhel5.i386) scriptlet failed, exit status 1
    error: install: %pre scriptlet failed (2), skipping MySQL-server-5.5.16-1.rhel5

    [root@]# rpm -qa | grep -i ‘^mysql-’
    MySQL-server-community-5.1.50-1.rhel5
    MySQL-shared-5.5.16-1.rhel5
    MySQL-client-5.5.16-1.rhel5

    Should I be remove the package MySQL-server-community-5.1.50-1.rhel5?

    Thanks

    • Hi Reddy,

      You could remove all these packages:
      MySQL-server-community-5.1.50-1.rhel5
      MySQL-shared-5.5.16-1.rhel5
      MySQL-client-5.5.16-1.rhel5

      And then install MySQL packages again. Remember take backups if you have any valuable data on your databases.

  38. Hi folks,
    I have a problem;
    centOS 5.7, mysql 5.5.17
    if I attempt to run the update in remi repository to load new libraries yum attempt to update my php 5.2.17 to 5.3.x

    I don’t need php 5.3 for lacking of backward compatibility.

    All “seems” to work fine but when I obtain access to phpmyadmin I receive a warning that “using previous libraries could lead to unexpected behavior” or something similiar…

    thank you very much for your help

    • Hi Gilas,

      Do you try to update all your packages or just MySQL with remi repository?

      Do you have installed phpMyAdmin from remi repository?

  39. Wonderful tutorials mate !! Clear and precise. I appreciate the effort that you have put into it. Keep up the good work

    God Speed

    Regards
    Andrew

  40. Thank you
    I tried:

    yum –enablerepo=remi,remi-test update –exclude=*php*

    (hmmm –exclude=*php* to avoid php update)

    this is the result:

    (...)
    Dependencies Resolved
     
    ================================================================================
     Package              Arch        Version                  Repository      Size
    ================================================================================
    Installing:
     libcurl-devel        x86_64      7.21.7-5.el5.remi.2      remi-test      286 k
         replacing  curl-devel.i386 7.15.5-9.el5_7.4
     
    Updating:
     curl                 x86_64      7.21.7-5.el5.remi.2      remi-test      250 k
     freetds              x86_64      0.82-6.el5.remi          remi           991 k
    Installing for dependencies:
     compat-libcurl3      x86_64      7.15.5-1.el5.remi        remi-test      182 k
     libcurl              x86_64      7.21.7-5.el5.remi.2      remi-test      202 k
     libssh2              x86_64      1.2.7-1.el5.rf           rpmforge       242 k
     
    Transaction Summary
    ================================================================================
    Install       4 Package(s)
    Upgrade       2 Package(s)

    ? I can’t understand how to do to update only the php libraries compatible with mysql 5.5.17 (?)

    Now I want only php 5.2.17 or lower not php 5.3. If I remove -exclude=*php* remi forces me to download php 5.3 (!)

    thank you…

    • What if you try simply following command:

      yum --enablerepo=remi,remi-test install mysql mysql-server

      Is it forcing you upgrade PHP? Could you post output here? php-mysql package might be package which cause your problem…

      • If I issue the command above, linux try to install the previous version of mysql as you can see here:

        Setting up Install Process
        Package mysql-5.5.17-1.el5.remi.x86_64 already installed and latest version
        Package mysql-server-5.5.17-1.el5.remi.x86_64 already installed and latest version
        Resolving Dependencies
        –> Running transaction check
        —> Package mysql.i386 0:5.0.77-4.el5_6.6 set to be updated
        –> Finished Dependency Resolution

        Dependencies Resolved

        ================================================================================
        Package Arch Version Repository Size
        ================================================================================
        Installing:
        mysql i386 5.0.77-4.el5_6.6 base 4.8 M

        Transaction Summary
        ================================================================================
        Install 1 Package(s)
        Upgrade 0 Package(s)

        —-

        Maybe that I’m not forced to update mysql to 5.5.7. Maybe that 5.5.7 is more stable (?).
        Eventually I should downgrade to 5.0.x?!? In this case it is easy … or should I reinstall package 5.0.x and run mysql_upgrade again without any problem for my databases? Thank you very much.

        • This looks very strange. So YUM is installing i386 (32-bit) and older MySQL package…do you have x86_84 (64-bit) CentOS?

          I think that the 5.0.77 on CentOS is very stable package, but I personally always want run latest and greatest packages. :)

          If you want to downgrade back to 5.0.77 then I recommend you to take backups from all databases and check this MySQL downgrade guide. So mysql_upgrade after downgrade should work…

          • Yep, I have a VPS updated to CentOS 5.7 and 64bit

            • Could you post output of following command:

              rpm -qa mysql mysql-server
  41. installed

  42. Hi JR,

    Could you show how to start the service in Fedora 16 since:

    service msyqld start

    won’t do it on fedora 16, could you show me how to start the service?? I tried

    systemctl start mysqld.service

    But systemctl can’t find this service

    • Hi Mauricio,

      Yes you are right service msyqld start (I update this guide also) is not working with Fedora 16 you have to use following command:

      systemctl start mysqld.service

      But currently it’s SELinux problem and is fixed on selinux-policy-3.10.0-56.fc16 so now do following (as root):

      grep mysqld_safe /var/log/audit/audit.log | audit2allow -M mysqlpol
      semodule -i mysqlpol.pp
       
      systemctl start mysqld.service

      And if you want MySQL start on boot then run following command:

      systemctl enable mysqld.service

      Please let me do you get it running?

  43. cuando doy el comando: systemctl start mysqld.service me sigue saliendo esto

    Job failed. See system logs and ‘systemctl status’ for details

    Uso fedora 16 y he borrado el archivo /etc/my.cnf, por que pense que ahi estaba el error como lo recupero

  44. el error salio despues de que di yum -y update y me actualizo mysql-server a la version 5.5.17

  45. Hi julio,

    Normally I don’t even release other then English comments, but now I even used Google Translate to get idea what you are trying to ask…but please use english, because comments in Spanish is moderated as spam on future.

    If you check this guide more more specifically, you can see that it’s SELinux problem and solution for your problem can be found on original install / update guide or comment just before your comments… :)

  46. Hi JR, thanks for your guides, without your assistance I would not stand a chance.

    I am using Fedora 16, upgraded on top of Fedora 15. When I am at chapter 5, I stumble upon problems you describe. So when I follow these instructions


    grep mysqld_safe /var/log/audit/audit.log | audit2allow -M mysqlpol
    semodule -i mysqlpol.pp

    systemctl start mysqld.service

    I get following error:

    [root@MikkoSundman mikko]# grep mysqld_safe /var/log/audit/audit.log | audit2allow -M mysqlpol semodule -i mysqlpol.pp
    could not open file mysqlpol.pp - "[Errno 2] No such file or directory: 'mysqlpol.pp'"

    as I am not 100% sure if should have the all commands in one happy lon g line, I tried splitting them:

    [root@MikkoSundman mikko]# grep mysqld_safe /var/log/audit/audit.log | audit2allow -M mysqlpol
    compilation failed:
    mysqlpol.te:6:ERROR 'syntax error' at token '' on line 6:

    /usr/bin/checkmodule: error(s) encountered while parsing configuration
    /usr/bin/checkmodule: loading policy configuration from mysqlpol.te
    [root@MikkoSundman mikko]#

    [root@MikkoSundman mikko]# semodule -i mysqlpol.pp
    semodule: Failed on mysqlpol.pp!
    [root@MikkoSundman mikko]#

    I know somuch that mysqlpol.pp does not exist in my system

    [root@MikkoSundman mikko]# whereis mysqplpol.pp
    mysqplpol:
    [root@MikkoSundman mikko]#

    Below info that may be in use to sort this out:

    [root@MikkoSundman mikko]# mysql --help
    mysql Ver 14.14 Distrib 5.5.16, for Linux (i686) using readline 5.1
    Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

    [root@MikkoSundman mikko]# yum list installed |grep mysql
    mysql.i686 5.5.16-3.fc16 @updates
    mysql-libs.i686 5.5.16-3.fc16 @updates
    mysql-server.i686 5.5.16-3.fc16 @updates
    [root@MikkoSundman mikko]#

    Has someone else encountered this?

    Thanks in advance!

    • Hi Mikko,

      Thank you for the compliment!

      Yes those SELinux related commands are two different commands. I also updated it more clear on this guide.

      Could you post output of following command here:

      grep mysqld_safe /var/log/audit/audit.log

      I can shorten or modify it later, if it’s needed. :)

  47. Uh oh, I think I fumbled a bit. or perhaps not.

    This is what happens when I do the code:

    [root@MikkoSundman mikko]# grep mysqld_safe /var/log/audit/audit.log
    [root@MikkoSundman mikko]#

    So I thought that all errors must have gone to this file. I opened it with gedit, file was about one meg so I planned to help you and make new, shorter. I deleted the log file, created the new, re-run the grep command and it stayed empty. Even erasing the SQL and installing all over again does not help, errors are same but log file stays empty. I have no clue what I am doing differently this time.

    (Unless original /var/log/audit/audit.log was created during fedora 16 upgrade and mysqld_safe does not generate any log data)

    I am off to rebooting this machine to see if anything appears in startup…

    -Mikko

    • Yea, that’s how it is,


      grep mysqld_safe /var/log/audit/audit.log

      does not generate any errors.

      I googled myself through SELinux basics via page I found and tried to follow instructions about missing AVC messages but make commands did not work.

      • Hi again Mikko,

        Do you have any messages on /var/log/audit/audit.log file or is it totally empty?

        Could you run following commands and post output here:

        grep mysql /var/log/messages
        ## AND ##
        systemctl status mysqld.service
        • Hi JR,

          Sorry for slow reply. I did leave this case for hold for quite some time. After my fumblings, /var/log/audit/audit.log really wastotally empty. It all did leave me totally clueless, so in the end I decided to re-install Fedora 16 to a empty hard drive.

          With latest updates on everything, installation seems to work now. Thanks for you help :)

          -Mikko

  48. Im have this problem too.

    [root@rrom-notebook ~]# mysql /var/log/messages
    ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
    [root@rrom-notebook ~]#
    [root@rrom-notebook ~]#
    [root@rrom-notebook ~]# systemctl status mysqld.service
    mysqld.service – MySQL database server
    Loaded: loaded (/lib/systemd/system/mysqld.service; enabled)
    Active: activating (start) since Sun, 27 Nov 2011 18:04:34 +0300; 286ms ago
    Process: 6274 ExecStartPost=/usr/libexec/mysqld-wait-ready $MAINPID (code=exited, status=1/FAILURE)
    Process: 6326 ExecStartPre=/usr/libexec/mysqld-prepare-db-dir (code=exited, status=0/SUCCESS)
    Main PID: 6273 (code=exited, status=1/FAILURE); Control: 6342
    CGroup: name=systemd:/system/mysqld.service
    └ 6479 /usr/libexec/mysqld –basedir=/usr –datadi…
    [root@rrom-notebook ~]#

    • Hi Roman,

      Could you post output of following commands:

      grep mysql /var/log/messages
       
      grep mysqld_safe /var/log/audit/audit.log
  49. grep mysql /var/log/messages – output -> http://www.sendspace.com/file/yuvqqp

    —————–
    [rrom@rrom-notebook ~]$ sudo grep mysqld_safe /var/log/audit/audit.log
    [rrom@rrom-notebook ~]$

    • Could you post also output of following commands:

      rpm -qa selinux-policy*
       
      grep -v ^# /etc/selinux/config
  50. Thank you for helping me

    [rrom@rrom-notebook ~]$ rpm -qa selinux-policy*
    selinux-policy-targeted-3.10.0-56.fc16.noarch
    selinux-policy-3.10.0-56.fc16.noarch
    [rrom@rrom-notebook ~]$
    [rrom@rrom-notebook ~]$

    [rrom@rrom-notebook ~]$
    [rrom@rrom-notebook ~]$ grep -v ^# /etc/selinux/config

    SELINUX=enforcing
    SELINUXTYPE=targeted

    [rrom@rrom-notebook ~]$

    • Hi again Roman,

      This SELinux bug should be fixed on selinux-policy-3.10.0-56 so it’s not your problem.

      So next question is that the, could you run other services (like httpd) using systemctl normally?

      And then could you post also following info:

      grep mysql /var/log/audit/audit.log
       
      wc -l /var/log/audit/audit.log

Leave a Comment

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

tour

Trackbacks/Pingbacks

  1. Install MySQL 5.1 (5.1.49) on Fedora 13, CentOS 5.5, Red Hat (RHEL … | mysql - [...] artykuł: Install MySQL 5.1 (5.1.49) on Fedora 13, CentOS 5.5, Red Hat (RHEL … a-server-providing, fedora, greatest-version, ...
  2. Creando una base de datos en MySQL para conectar con Haskell | Sólo para Mí! - [...] rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) Fuente: http://www.if-not-true-then-false.com/2010/install-mysql-on-fedora-centos-red-hat-rhel/ [...]
Bear