1. Download and decompress MySQL database wget Http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.11-linux-glibc2.5-x86_64.tar.gzs Tar- XVF mysql-5.7.11-linux-glibc2.5-x86_64.tar.gz-c/usr/local/mysql-5.7.11 2. Create a soft link ln-s mysql-5.7.11 mysql 3. Create MySQL user and modify software permissions useradd-r-m-s/sbin/nologin mysql chown-r mysql.mysql/usr/local/mysql-5.7.11 chown-r mysq L.mysql/usr/local/mysql chgrp-r mysql/usr/local/mysql-5.7.11 4. Installing and initializing the database Cd/usr/local/mysql-5.7.11/bin/mysql _install_db--user=mysql--basedir=/usr/local/mysql-5.7.11/--datadir=/usr/local/mysql-5.7.11/data/--must be in MySQL root Directory to install MySQL, otherwise error cp-a./support-files/my-default.cnf/etc/my.cnf cp-a./support-files/mysql.server/etc/init.d/mys Qld modify/ETC/MY.CNF Basedir =/usr/local/mysql-5.7.11
DataDir =/usr/local/mysql-5.7.11/data
Port = 3306#cd bin/#./mysqld_safe--user=mysql & [[email protected] scripts]#/etc/init.d/mysqld restart shutting down Mysql.. [OK] Starting MySQL ... [OK] Close is/etc/init.d/mysqld stop #开机启动 chkconfig--level mysqld on 5. Initializing the password mysql5.7 generates an initial password, and the first login in the previous version does not require a login. Shell> Cat/root/.mysql_secret./mysql-uroot-p SET PASSWORD = PASSWORD (' root '); Flush privileges open access
[Email Protected]_199_194_centos bin]# mysql-uroot-proot
MySQL [(None)]> GRANT all privileges on * * to ' root ' @ '% ' identified by ' root ' with GRANT OPTION;
MySQL [(None)]> flush privileges;
Linux CENTOS7 installation mysql-5.7.11