Install MySQL5.6.16 in RPM mode in Centos 6.5

Source: Internet
Author: User

Install MySQL5.6.16 in RPM mode in Centos 6.5
This document describes how to install MySQL5.6.16 using RPM. The detailed steps are as follows. Note that different versions may have different installation methods.

  1. Check whether MySQL and related RPM packages are installed. If yes, remove (rpm-e name)
    [Root @ purecentosLinux] # rpm-qa | grep-imysql
    Mysql-libs-5.1.71-1.el6.x86_64
    [Root @ purecentosLinux] # yum-yremovemysql-libs *
  2. Download the RPM package corresponding to Linux, for example, the RPM package corresponding to CentOS6.4 _ 64, as shown below:
  3. Install MySQL. This step depends on some third-party rpm packages. It is best to have the yum source installed.
    Yum-y -- nogpgcheck localinstall MySQL *
  4. Create a configuration file (this step varies depending on the database version)
    [Root @ purecentosLinux] # cp/usr/share/mysql/my-default.cnf/etc/my. cnf
  5. Initialize MySQL
    [Root @ purecentosLinux] #/usr/bin/mysql_install_db
    [Root @ purecentosLinux] # servicemysqlstart
  6. Set Password
    1. View the random password (this step varies depending on the database version)
      [Root @ purecentosLinux] # cat/root/. mysql_secret
      # TherandompasswordsetfortherootuseratWedDec3008: 18: 472015 (localtime): IlYDRZCs
    2. Log on with a random password
      [Root @ purecentosLinux] # mysql-uroot-pIlYDRZCs
    3. Set new password
      Mysql> SETPASSWORD = PASSWORD ('20140901 ');
  7. Common configurations
    1. Allow Remote Login
      Mysql> use mysql;
      mysql>selecthost,user,password from user;
      mysql>update usersetpassword=password('123456') where user='root';
      mysql> update usersethost='%'where user='root'and host='localhost';
      Mysql> flush privileges;
      mysql>exit
    2. Set auto-start
      [Root @ purecentosLinux] # chkconfigmysqlon
      [Root @ purecentosLinux] # chkconfig -- list | grepmysql
      Mysql0: off1: off2: on3: on4: on5: on6: off
  8. Default installation location of MySQL
    /var/lib/mysql/# Database directory
    /usr/share/mysql# Configuration file directory
    /usr/bin# Related command Directories
    /etc/init.d/mysql# Startup Script
  9. View Character Set
    Show variables like '% collation % ';
    Show variables like '% char % ';
  10. By default, port 3306 is intercepted by the firewall. To simplify the process, you can directly disable the firewall.
    Service iptables stop
    Chkconfig iptables off
  11. Modify the default configuration
    Modify the character set and data storage path, configure the/etc/my. cnf file, modify the data storage path, mysql. sock path, and default UTF-8 encoding.
[Client] password = 123456 port = 3306default-character-set = utf8 [mysqld] port = 3306character_set_server = utf8character_set_client = utf8collation-server = character = 1 # (note that after mysql is installed in linux, the default is: table names are case sensitive and column names are case insensitive. 0: case sensitive and 1: Case Insensitive.) max_connections = 1000 # (sets the maximum number of connections. The default value is 151, the maximum number of connections allowed by the MySQL server is 16384.) max_allowed_packet = 16Minnodb_buffer_pool_size = 256Minnodb_additional_mem_pool_size = 20 M [mysql] default-character-set = utf8

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.