MySQL 5.7.18 release Installation Guide (including the binfile version) and 5.7.18release
The installation process is basically the same as that of the source code version. In addition to the compilation process, this article only talks about the release version, which contains the binfile version.
Benefit: each user can install their own MySQL Server
Target host system: CentOS 6.8
User: saojie (No administrator permission)
Directory:/home/saojie/mysql-5.7.18
Download
Linux Generic
Address: https://dev.mysql.com/downloads/mysql/
Extract
tar zxvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gzmv mysql-5.7.18-linux-glibc2.5-x86_64 mysql-5.7.18
Install
Write configuration file
Put my. cnf in the mysql-5.7.18 directory
[Mysqld] basedir =/home/saojie/mysql-5.7.18datadir =/home/saojie/mysql-5.7.18/datalog_error =/home/saojie/mysql-5.7.18/data/mysql_error.logport = 33306 # port to avoid conflict socket =/ home/saojie/mysql-5.7.18/mysql. sockgeneral_log = onsql_mode = NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES
[mysql]socket = /home/saojie/mysql-5.7.18/mysql.sock
Initialization
bin/mysqld --defaults-file=/home/saojie/mysql-5.7.18/my.cnf --initialize --user=saojie --basedir=/home/saojie/mysql-5.7.18/ --datadir=/home/saojie/mysql-5.7.18/data
A random root password is generated during initialization.
Start
The first time you start adding a socket to avoid connecting to another MySQL Server, and because root does not have the remote access permission by default, root cannot connect through the specified IP address and port at the beginning
Bin/mysqld -- defaults-file =/home/saojie/mysql-5.7.18/my. cnf & mysql-uroot-p -- socket =/home/saojie/mysql-5.7.18/mysql. sock # other MySQL servers may be connected without socket
Close
bin/mysqladmin -uroot -proot --socket=/home/saojie/mysql-5.7.18/mysql.sock shutdown
Or
bin/mysqladmin -hxxx -Pxxx -uroot -proot shutdown
Other problems
Slow JDBC connection
Add skip-name-resolve to the configuration file [mysqld] and restart it to skip DNS query.
Do not output MySQL logs to the saojie user Console
Specify the log_error address under [mysqld]
Convenient script
#!/bin/bashfunction client(){ bin/mysql --defaults-extra-file=/home/saojie/mysql-5.7.18/my.cnf}function server(){ bin/mysqld --defaults-extra-file=/home/saojie/mysql-5.7.18/my.cnf &}function stop(){ bin/mysqladmin -uroot -p --socket=/home/saojie/mysql-5.7.18/mysql.sock shutdown}function pid(){ ret=$(ps -ef |grep mysqld | awk '{print $2}') echo $ret}if [ $# = 1 ]; then $1; else server; fi
The above is the MySQL 5.7.18 release Installation Guide introduced by the editor. I hope it will help you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!