easypanel(CentOS6.x)升级MySQL版本5.1到5.6

  • rpm -ivh http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community-release-el6-5.noarch.rpm
  • rm -rf /etc/yum.repos.d/mysql-community.repo
  • rm -rf /etc/yum.repos.d/mysql-community-source.repo
  • wget http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community.repo -O /etc/yum.repos.d/mysql-community.repo
  • wget http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community-source.repo -O /etc/yum.repos.d/mysql-community-source.repo
  • yum -y update
  • yum -y install mysql mysql-server
  • yum localinstall mysql-community-release-el6-5.noarch.rpm
  • yum install mysql-community-server
  • rm -rf /var/lib/mysql/ibdata1
  • rm -rf /var/lib/mysql/ib_logfile0
  • rm -rf /var/lib/mysql/ib_logfile1
  • service mysqld restart
  • chkconfig –level 2345 mysqld on
  •  

    确认版本信息:

    [root@west195246 bin]# mysql -V
    mysql  Ver 14.14 Distrib 5.6.20, for Linux (x86_64) using  EditLine wrapper

    最后请修改/etc/my.cnf为mysql5.6的版本,如果升级还是以前5.1的,不通用,可能会导致一些未知问题

    官方文档:http://dev.mysql.com/doc/refman/ … efault-changes.html

    1. vi /etc/my.cnf

    复制代码

     

    1. # For advice on how to change settings please see
    2. # http://dev.mysql.com/doc/refman/ … ation-defaults.html

    3. [mysqld]
    4. #
    5. # Remove leading # and set to the amount of RAM for the most important data
    6. # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
    7. innodb_buffer_pool_size = 8M
    8. #
    9. # Remove leading # to turn on a very important data integrity option: logging
    10. # changes to the binary log between backups.
    11. # log_bin
    12. #
    13. # Remove leading # to set options mainly useful for reporting servers.
    14. # The server defaults are faster for transactions and fast SELECTs.
    15. # Adjust sizes as needed, experiment to find the optimal values.
    16. join_buffer_size = 8M
    17. sort_buffer_size = 2M
    18. read_rnd_buffer_size = 2M
    19. datadir=/var/lib/mysql
    20. socket=/var/lib/mysql/mysql.sock
    21. log-bin
    22. skip-networking
    23. default-time-zone = ‘+8:00’
    24. performance_schema_max_table_instances=200
    25. table_definition_cache=200
    26. table_open_cache=128

    27. # Disabling symbolic-links is recommended to prevent assorted security risks
    28. symbolic-links=0

    29. # Recommended in standard MySQL setup
    30. sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

    31. [mysqld_safe]
    32. log-error=/var/log/mysqld.log
    33. pid-file=/var/run/mysqld/mysqld.pid

    复制代码

     

    1.增加配置项,重启

    1. vi /etc/my.cnf

    复制代码





    [mysqld]

    performance_schema=on


    1. service mysqld restart

    复制代码





    2.SSH运行命令升级

    mysql_upgrade -uroot -p数据库密码

     

     

    参考小樱之数据库升级

    发表评论

    邮箱地址不会被公开。 必填项已用*标注