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