MySQL Red hat linux

Upgrade MySQL to Version 5.6 in CentOS

Backup all the database and stop mysql

 mysqldump -u (userid) -p (password) --all-databases > all-databases.sql
service mysqld stop

Download the Repo for MySql 5.6

wget http://dev.mysql.com/get/mysql-community-release-el6-3.noarch.rpm/from/http://repo.mysql.com/

Install the repository from the local file

yum localinstall mysql-community-release-el6-3.noarch.rpm

Install the latest MySql

yum install mysql-community-server
service mysqld start

Configure MySQL to start automatically on Server Reboot

chkconfig mysqld on
chkconfig —list mysqld

Need to apply some tweaks
Its not like the previous versions that tweaks are not required. From Version 5.6 onwards few tweaks are required to make it work fine.

Edit my.cnf file.

vi /etc/my.cnf

Make this changes

innodb_buffer_pool_size=2G  (Allot 50-80% of RAM)
innodb_log_file_size=256M
innodb_flush_neighbors=0
innodb_flush_log_at_trx_commit=2

# Default to UTF-8 for text columns

character-set-server=utf8mb4
collation-server=utf8mb4_general_ci
timezone=GMT (This one is optional)
sql-mode="STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY"

If few attributes are not there in the file then paste it.

Restart MySQL / Apache Service

service mysqld restart
service httpd restart

Loading

Leave a Reply

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