How to Install MySQL 5.6 from official Yum reposit

Source: Internet
Author: User

Tags: MySQL distribution: CentOS

Submitted By:morgan Tocker
MySQL Community Manager @ Oracle

Introduction

In October, the MySQL development team officially launched support for Yum repositories. This means so can now ensure so you had the latest and greatest version of MySQL installed directly from the sour Ce!

In this guide we'll install MySQL 5.6 on a fresh installation of Centos 6, and then apply a couple of extra touches to O Ptimize configuration for Digitalocean.

If you aren't familiar with the changes to MySQL 5.6, I recommend getting started with what's new in MySQL 5.6. There ' s a number of very useful features.

Selecting a Server

For today I'll be choosing the $40/month server, since it includes 4G of RAM and a 60GB SSD, but is free to choose A different size depending on the demands of your application. MySQL can install on the systems with very small amounts of RAM, as-well as scale up-to-over 100GB. If you chose a different server size, please just make sure to adjust the configuration advice recommended below:

The official repositories support both 32-bit and 64-bit Enterprise Linux 6, as well as Fedora & 19. CentOS is the Community Enterprise Operating System and works fine for this purpose:

Installing MySQL

The Yum repository file needs to is downloaded from MySQL ' s developer website. Once installed, a simple would make yum update sure you is running on the latest point release of MySQL 5.6, including security Updates. Yum also ensures that any dependencies is also installed, which makes the installation process just a bit simpler.

To get started, go to http://dev.mysql.com/downloads/repo/, and click on download link for Red Hat Enterprise Linux 6/or Acle Linux 6:

Then copy the link under ' No Thanks, just start my download ':

Log into your server and then download the this file. Below is an example url--your may want to double-check there are not a later version of the repo available:

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:

sudo yum localinstall mysql-community-release-el6-*.noarch.rpm

Your now has the official repository installed on your server, but with no software installed. The repository includes the MySQL Server, the MySQL Workbench administration tool and the ODBC driver. Let ' s install the MySQL Server:

sudo yum install Mysql-community-server

Start MySQL:

sudo service mysqld start

Configure MySQL to start automatically on reboot:

sudo chkconfig mysqld onchkconfig--list mysqld

That ' s it. You ' re all set!

Applying finishing Touches

The MySQL development team put in a lot of effort to make sure that MySQL was better tuned out of the box, and 5.6 requires Very little configuration. Have said that, there'll be a couple of things you'll want to tweak, which can added to /etc/my.cnf under the [mysq LD] Heading Group:

sudo vim/etc/my.cnf
  • It is the recommended to set to innodb_buffer_pool_size 50-80% of system memory. In the case of the server I selected, 50% of 4GB = 2GB. This allows MySQL-to-cache more data (the default was only 128M) and can improve performance significantly.

  • MySQL defaults to have very small transaction logs, which is a feature used to provide crash recovery. In development small log files can is useful to save space, but in production you'll want to increase these to allow Mor E writes to queue up in the background. The setting is and innodb_log_file_size recommended values range between 128M and 4G.

  • When using the SSDs, sequential io is no faster than random IO. This means we can tell MySQL it can disable one of the optimizations it does and save a little CPU. The setting is innodb_flush_neighbors=0 .

  • By default, MySQL was exceptionally cautious to not lose any data even if there is a power loss. This comes at a performance cost, and in many cloud environments the users chose to allow a few seconds of the data loss on power Failure instead. The setting to change is innodb_flush_log_at_trx_commit=2 .

  • UTF-8 is a better the default for storing international characters in MySQL. You can change to it by setting character-set-server=utf8mb4 and collation-server=utf8mb4_general_ci . Individual databases, tables and columns can still overwrite this if necessary.

  • Many syadmins recommend setting the timezone of servers to GMT, which can is done with timezone=GMT .

  • To ensure compatibility with older versions, MySQL defaults to allowing incorrect and out of range values. I recommend that you enable the new stricter SQL_MODE options as long as your application (s) does not rely on this legacy MySQL Behaviour.

*all together, these is the changes:

innodb_buffer_pool_size=2ginnodb_log_file_size=256minnodb_flush_neighbors=0innodb_flush _log_at_trx_commit=2# default to utf-8 for text columnscharacter-set-server= utf8mb4collation-server=utf8mb4_general_ci# set the default timezone to gmt.#  this is a common recommended practice, but can also remove  this line# if your date/time values appear incorrect.timezone=gmt#  This configuration item is optional:# It makes MySQL more  strict and rejects invalid values.# you may need to remove  This line for legacy applications.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 "
Further Reading

This concludes the basic installation of the MySQL 5.6 using the official Yum repos. The MySQL team is interested in hearing your feedback. If you encounter any issues or simply has a suggestion, please visithttp://forums.mysql.com/list.php?11.

I also has a more advanced version of what the Configure in MySQL 5.6 after installation available on my blog. But rest assured, if you have followed the steps in this article, you are 95% of the the-the-there!


How to Install MySQL 5.6 from official Yum reposit

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.