centos7安装mysql8二进制

2019-05-10

centos7安装mysql8二进制

1、https://dev.mysql.com/downloads/mysql/
2、选择MySQL Community Server 8.0.16 /RHEL/64bit/Compressed TAR Archive
mysql-8.0.16-el7-x86_64.tar.gz
MD5: eb1d0b7cf3857c24c8892ab23832ddf4
Size: 688.2M
https://dev.mysql.com/downloads/file/?id=485972
3、download
wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.16-el7-x86_64.tar.gz -P untar
4、uncompress
cd /opt/LNMP
tar zxf mysql-8.0.16-el7-x86_64.tar.gz

mv mysql-8.0.16 /usr/local/mysql
5、初始化

sed -i '/mysql/d' /etc/security/limits.conf
cat >> /etc/security/limits.conf << EOF
mysql soft nproc 65536
mysql hard nproc 65536
mysql soft nofile 65536
mysql hard nofile 65536
EOF

cp /opt/LNMP/untar/conf/my.cnf /usr/local/mysql
#cp /opt/LNMP/mysql-8.0.16/support-files/my-small.cnf /usr/local/mysql/my.cnf

cd /usr/local/mysql
#./scripts/mysql_install_db --datadir=/var/lib/mysql --user=mysql
./bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/var/lib/mysql
./bin/mysql_ssl_rsa_setup --user=mysql --basedir=/usr/local/mysql --datadir=/var/lib/mysql
#使用 debug 模式mysqld-debug --initialize-insecure --debug=d,info,error,query,general,where:O,/tmp/mysqld.trace

cp /opt/LNMP/mysql-8.0.16/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig mysqld on
/etc/init.d/mysqld start

./bin/mysqladmin -u root password '123456'
#./bin/mysqld_safe &

netstat -ntlp |grep 3306

6、修改/etc/my.cnf
systemctl restart mysqld.service重启
[mysqld]
#datadir=/var/lib/mysql
#socket=/var/lib/mysql/mysql.sock

datadir=/data1/mysql
socket=/data1/mysql/mysql.sock
skip-log-bin

分类:数据库 | 标签: |

相关日志

评论被关闭!