f将mysql二进制包传到linux服务器上/usr/local目录下
tar -zvxf mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz mysql
更改用户用户和组
chown -R mysql:mysql mysql/
cd mysql/support-files
touch my_default.cnf
vim my_default.cnf
复制以下内容到文件中:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
# 一般配置选项
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
socket = /var/run/mysqld/mysqld.sock
#socket=/tm