Remove already installed version Yum List installed mysql[[email protected] ~]# Yum list installed mysqlloaded plugins:fastestmirror, refres H-packagekit, securityloading mirror speeds from cached hostfile* base:mirrors.cn99.com* extras:mirrors.cn99.com* updat es:mirrors.cn99.comInstalled packagesmysql.x86_64 yum remove mysql.x86_64 1. Download Install wget https:// Cdn.mysql.com//downloads/mysql-5.7/mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz (Axel Multi-threaded download: Axel-n https:// cdn.mysql.com//downloads/mysql-5.7/mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz) tar-xvzf MYSQL-5.7.20-LINUX-GLIBC2.12-X86_64.TAR.GZ MV mysql-5.7.20-linux-glibc2.12-x86_64/usr/local/mysql Add user and user groups, directory permissions Groupadd mysqluseradd mysql-g mysqlcd mysqlchown-r mysql. chgrp-r mysql . install dependent libraries Yum install Libaioyum INSTALL-Y libnuma.so.1 Installation Database (database initialization) Cd/usr/local/mysqlmkdir datacd/usr/local/mysql/bin./mysql_install_db-- User=mysql--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/data -------Note that the data store directory because/directory space is small enoughUse, so I stored the data under/data/mysql57, i.e. Mkdir/data/mysql57chown-r mysql/data/mysql57chgrp-r mysql/data/mysql57cd/usr/local/ mysql/bin ./mysql_install_db--user=mysql--basedir=/usr/local/mysql/--datadir=/data/mysql57 Problems you may encounter here: Installing MySQL system Tables..../bin/mysqld:error while loading shared libraries:libnuma.so.1:cannot open Shared object File:no Such file or directory reason: is installed with Yum libnuma.so.1, installed by default is 32, but the DB requires 64-bit WORKAROUND: 1. If the libnuma.so.1 is already installed, yum remove libnuma.so.1; install yum-y installed numactl.x86_64 2. Start Login cd/usr/local/ Mysql/support-files./mysql.server start Log in to MySQL, this version of the newest version of the password is not allowed to login, in fact, there is an initial password saved in/root/.mysql_secret this file , use this password the first time you log in, and then change the password. So first cat view under the initialization password (random, each installation sees the same password): [[email protected] ~]# cat/root/.mysql_secret cd/usr/local/ MYSQL/BIN./MYSQL-UROOT-PI+0TKC3 (kds/ change to MySQL root password, the new password is ' Leizm ' Mysql> set password= Password (' 12root '); Query OK, 0 rows affected, 1 Warning (0.00 sec) granT all privileges on * * to [email protected] '% ' identified by ' 123456a '; flush privileges; 3. Add system service shell> CP support-files/mysql.server/etc/init.d/mysqldshell> Service mysqld start http:// blog.51cto.com/pengjc/1861088 if the startup process or the MySQL client connection has a problem configuring my.cnfvi/etc/my.cnf [mysqld]bind-address=0.0.0.0 #mysql安装根目录basedir =/usr/local/mysql#datadir=/var/lib/mysqldatadir=/data/mysql57#socket=/var/lib/mysql/ mysql.socksocket=/data/mysql57/mysql.sockuser=mysql# disabling symbolic-links is recommended to prevent assorted Security riskssymbolic-links=0 #Port number to connections.port=15024 #innodb_buffer_pool_size = 256mmax_allowed_packet = 32m#query_cache_size = 128m max_connections=300 log-bin=mysql-binserver-id= 10632 [client]socket =/data/mysql57/mysql.sock [mysqld_safe]log-error=/var/log/ mysqld.logpid-file=/var/run/mysqld/mysqld.pid mysql5.7 configuration file my.cnf settings http://www.voidcn.com/article/ P-zrikccdi-hr.html
Install mysql-5.7.20-linux-glibc2.12-x86_64.tar.gz under MySQL installation-centos6