CentOS6.8 under Installation MySQL5.6

Source: Internet
Author: User

One: Uninstall the old version

use the following command to check if the installation has MySQL Server

Rpm-qa | grep MySQL

Some words are unloaded by the following command

RPM-E MySQL       //normal Delete mode rpm-e--nodeps mysql        //brute force Delete mode, if you use the above command to delete, prompted to have other dependent files, then use this command can be strongly deleted

Two: Installation Mysql

Install packages required for compiling code

Yum-y install make gcc-c++ cmake bison-devel  ncurses-devel
DownloadMySQL-5.6.35
#wget Https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz#tar XVF MYSQL-5.6.35-LINUX-GLIBC2.5-X86_64.TAR.GZ#MV Mysql-5.6.35-linux-glibc2.5-x86_64/usr/local/mysql

Create MySQL users and groups

#groupadd mysql#useradd-r-G MySQL mysql-d/usr/local/mysql#echo "Mima" | passwd--stdin MySQL

Modify Directory Permissions

Chown-r Mysql:mysql/usr/local/mysql

Installing the Database

#su-mysql#/usr/local/mysql/scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/ Mysql/data#exit

Copy MySQL configuration file

#cd/USR/LOCAL/MYSQL/SUPPORT-FILES#CP my-default.cnf/etc/my.cnf

Adding system Services

#cp mysql.server/etc/init.d/mysql#chkconfig MySQL on

. Add Environment variables

#vim/etc/profileexport mysql_home= "/usr/local/mysql" Export path= "$PATH: $MYSQL _home/bin" #source/etc/profile

Start MySQL

Service MySQL Start

Set Root password

mysqladmin-u root password ' 123456 '

Set the default port

#vim/etc/my.cnf[mysqld]basedir=/usr/local/mysqldatadir=/usr/local/mysql/dataport=3306server_id=1socket=/tmp/ Mysql.sock

Allow all external links to access (optional)

#mysql-u root-p#mysql command Line input GRANT all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION; FLUSH privileges;

 

Reference Documentation:

Http://www.cnblogs.com/liuyi2614/p/6382183.html

  

  

  

CentOS6.8 under Installation MySQL5.6

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.