Update MySQL version from 5.1 to 5.5 in CentOS 6.2

前端 未结 8 2125
萌比男神i
萌比男神i 2020-12-04 05:33

I tried to update MySQL from 5.1 to 5.5 in CentOS 6.2. The following is the process I did:

1. rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
2. yu         


        
8条回答
  •  一生所求
    2020-12-04 05:50

    2015/08/19 - For those of you working on older (but still decent) hardware with a matching OS (typically 32 bit machines).

    -- This will upgrade to mysql 5.6 community not 5.5 --

    This worked for me after some research and mixing/matching/testing the answers found on various page of the internet (mainly from this page and http://dev.mysql.com/doc/refman/5.6/en/linux-installation-yum-repo.html). My OS shipped with mysql 5.1, I wanted to have 5.6.

    My system

    [root@host]# cat /etc/*release 
    CentOS release 6.7 (Final)
    [root@host]# uname -a
    Linux host 2.6.32-573.3.1.el6.i686 #1 SMP Thu Aug 13 19:58:36 UTC 2015 i686 i686 i386 GNU/Linux
    [root@host]# arch
    i686
    

    This is installed on a 2006 mac pro 1.1 (CPUs upgraded to 3.0GHz Intel Xeon X5365 Quad-Core).

    Commands I ran

    This was done almost immediately after a fresh install of the OS and system update via yum

    list mysql currently installed

    yum list installed | grep -i mysql
    

    remove installed msql

    yum remove mysql mysql-*
    

    list mysql currently installed

    yum list installed | grep -i mysql
    

    Download rpm containing mysql 5.6

    wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
    

    Install mysql

    rpm -Uvh mysql-community-release-el6-5.noarch.rpm
    yum install mysql mysql-server
    

    list mysql currently installed

    yum list installed | grep -i mysql
    

    ensure mysql starts on reboot

    chkconfig --list mysqld
    sudo chkconfig mysqld on
    chkconfig --list mysqld
    

    Start mysql

    service mysqld start
    service mysqld status
    

    Result

    [root@host]# yum list installed | grep -i mysql
    compat-mysql51.i686     5.1.54-1.el6.remi @remi                                 
    mysql-community-client.i686
                            5.6.26-2.el6      @mysql56-community                    
    mysql-community-common.i686
                            5.6.26-2.el6      @mysql56-community                    
    mysql-community-libs.i686
                            5.6.26-2.el6      @mysql56-community                    
    mysql-community-release.noarch
    mysql-community-server.i686
                            5.6.26-2.el6      @mysql56-community                    
    perl-DBD-MySQL.i686     4.013-3.el6       @base
    
    
    [root@host]# mysql --version
    mysql  Ver 14.14 Distrib 5.6.26, for Linux (i686) using  EditLine wrapper
    

    mysql config (I did not touch this yet but the info seems legit)

    Some interesting basic but efficient performance tuning for mysql:

    https://www.digitalocean.com/community/tutorials/how-to-install-mysql-5-6-from-official-yum-repositories

    Good luck!

    Edit

    I had some issues creating users and granting permissions, this how it was fixed.

    Error

    ERROR 1054 (42S22) at line 1: Unknown column 'plugin' in 'mysql.user'
    

    Fix

    1. Logged on the server as root
    2. Connected to mysql with a simple mysql
    3. Checked the outcome of this statement: SELECT COUNT(1) column_count FROM information_schema.columns WHERE table_schema='mysql' AND table_name='user'; The result was 39, 43 is expected for mysql 5.6
    4. Issued this statement to update the root password: update mysql.user set Password=PASSWORD('root') where User='root';
    5. (Logged off mysql with exit)
    6. Restarted mysql with: service mysqld restart
    7. Ran: mysql_upgrade -uroot -proot --force
    8. Reconnected to mysql with mysql -uroot -proot
    9. Checked the outcome of this statement: SELECT COUNT(1) column_count FROM information_schema.columns WHERE table_schema='mysql' AND table_name='user'; The result was 43 as expected for mysql 5.6. I was then able to create my users and grant permissions as needed.

提交回复
热议问题