tar -zxvf mysql-5.6.45-linux-glibc2.12-x86_64.tar.gz
将解压后的文件重命名为mysql
mv mysql-5.6.45-linux-glibc2.12-x86_64 mysql
进入Mysql目录,添加MySQL配置,创建Mysql用户组及用户
cp support-files/my-default.cnf /etc/my.cnf
#创建mysql用户组及用户
groupadd mysql
useradd -r -g mysql mysql
编辑/etc/my.cnf文件
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required
basedir = /usr/local/java/mysql5.6
datadir = /usr/local/java/mysql5.6/data
port = 3306
# server_id = .....
socket = /usr/local/java/mysql5.6/mysql.sock
character-set-server = utf8
log-error=/usr/local/java/mysql5.6/data/error.log
pid-file=/usr/local/java/mysql5.6/data/mysqld.pid
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
在mysql当前目录下设定目录的访问权限(注意后面的小点,表示当前目录)
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data