依赖记录
- wget
- perl
- numactl
第一步:download
$ wget https://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.41-linux-glibc2.12-x86_64.tar.gz
**第二步:添加用户***
$ useradd mysql -s /sbin/nologin -M
第三步:安装mysql
$ tar -zxvf mysql-5.6.41-linux-glibc2.12-x86_64.tar.gz
$ mv mysql-5.6.41-linux-glibc2.12-x86_64 /usr/local/mysql
$ chown -R mysql:mysql /usr/local/mysql
$ mkdir -p /data/mysql
$ chown -R mysql:mysql /data/mysql
$ cd /usr/local/mysql
$ cp support-files/mysql.server /etc/init.d/mysqld
$ chmod +x /etc/init.d/mysqld
$ echo > /etc/my.cnf <<EOF
[client]
port = 3306
socket = /tmp/mysqld.sock
[mysqld]
port = 3306
bind-address=127.0.0.1
socket = /tmp/mysqld.sock
basedir = /usr/local/mysql
datadir = /data/mysql
symbolic-links=0
[mysqld_safe]
log-error=/data/mysql/mysqld.log
pid-file=/data/mysql/mysqld.pid
EOF
$ ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql --basedir=/usr/local/mysql
第四步:启动MySQL
$ service mysql start
转载于:https://blog.51cto.com/idweb/2322081