Packet Naming format interpretation
mysql-5.7.15-linux-glibc2.5-x86_64.tar.gz Black Bold indicates that the package name blue indicates that the Linux system binary package red represents the frame 1, upload mysql-5.7.15-linux-glibc2.5-x86_64. tar.gz to the server, you can use the wget official download, or use FTP to upload the pre-downloaded to the server. and install the dependency package yum install LIBAIO  2, create MySQL user and MySQL user group, do not allow shell login. groupadd mysqluseradd mysql-g mysqlusermod mysql-s/bin/nologin 3, decompression mysql-5.7.15-linux-glibc2.5-x86_64. tar.gz to the specified directory/usr/local/mysql/, do not have this folder please first build this MySQL folder with mkdir tar-zxvf mysql-5.7.15-linux-glibc2.5-x86_ 64.tar.gz-c/usr/local/mysql/ 4, grant all MySQL folder permissions to the MySQL user [[email protected] mysql]# chown-r Mysql:mysql. /MYSQL   5, create related directory [[email protected] etc]# cd/data/[[email protected] data]# mkdir Mysql[[email protected] data]# chown mysql:mysql mysql/ 6, modify the/etc/my.cnf configuration file, the first system comes with MY.CNF, this recommendation mv/etc/ My.cnf/etc/my.cnf.back backup, copy [[email protected] mysql]# CP support-files/my-default.cnf/etc/my.cnf to/ ETC under configuration content [client] #password = [Your_password] #socket =/usr/local/mysql/mysql.sockdefault-character-set= Utf8 [mysqld]user = Mysqlport = 3306socket =/usr/local/mysql/mysql.sockback_log = 120max_connections = 3000ma X_connect_errors = 30max_allowed_packet = 32mbinlog_cache_size = 4mmax_heap_table_size = 128Msort_buffer_size = 16Mjoin_ Buffer_size = 16mquery_cache_size = 128mquery_cache_limit = 4mft_min_word_len = 8transaction_isolation = Repeatable-readkey_buffer_size = 128mread_buffer_size = 8mskip_name_resolve = 1basedir =/usr/local/mysqldatadir =/data /mysqltmpdir =/tmplog_error = Error.logdefault-storage-engine = Innodbcharacter-set-server = Utf8collation-server = Utf8_general_ciserver-id = 1 [mysql]no-auto-rehash 7, initializes the database, and changes the root user password./bin/mysqld--initialize-- Datadir=/data/mysql--user=mysql #初始化数据库的时候, the last line of output will have a root user's random password, remember this random password, The first time you log in with the root user is the random password. Modify the root user's password before you perform other command operations. If no prompt message appears at the command line, the root random password is in the Error.log error log. The command is as follows: SET PASSWORD for 'root ' @ ' localhost ' = PASSWORD ('newpassword '); 4. Turn on MySQL service, I am starting with MySQL user. /usr/local/mysql/support-files/mysql.server Start Appendix: 1, Connection database encountered error [[email protected] bin]#./mysql-u root-penter Passwo Rd:error 2002 (HY000): Can ' t connect to local MySQL server through socket '/tmp/mysql.sock ' (2) resolved, establish a soft connection to MYSQL.S in the/tmp directory ock file path [[email protected] tmp]# ln-s/usr/local/mysql/mysql.sock mysql.sock
Ehel installing the MySQL binary package