#参考资料
官网:https://dev.mysql.com/doc/refman/8.0/en/binary-installation.html
个人博客:https://www.xingchenw.cn/article/179
博客园:http://www.cnblogs.com/guanshanmao/p/9233898.html
优快云:https://blog.youkuaiyun.com/xintingandzhouyang/article/details/80956348
#yum安装mysql
- wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
- rpm -ivh mysql80-community-release-el7-1.noarch.rpm
- yum install mysql-server -y
- grep "temporary password" /var/log/mysqld.log
- mysql -u root -p
- alter user 'root'@'localhost' identified by '新密码';
#通用二进制包安装mysql
- //准备工作
- yum install libaio-devel numactl-devel -y
- groupadd mysql
- useradd -g mysql -s /bin/false mysql
- vim /etc/my.cnf
-
datadir=/usr/local/mysql/data socket =/usr/local/mysql/mysql.sock #symbolic-links=0 log-error=/usr/local/mysql/mysql.log pid-file =/usr/local/mysql/mysql.pid
- chmod 644 /etc/my.cnf
- //下载解压
- wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.12-linux-glibc2.12-x86_64.tar.xz
- xz -d mysql-8.0.12-linux-glibc2.12-x86_64.tar.xz
- tar -xvf mysql-8.0.12-linux-glibc2.12-x86_64.tar
- mv mysql-8.0.12-linux-glibc2.12-x86_64/ /usr/local/mysql
- chown -R mysql:mysql /usr/local/mysql
- cd /usr/local/mysql
- touch mysql.log
- //配置启动
- bin/mysqld --initialize --user=mysql
- bin/mysql_ssl_rsa_setup
- bin/mysqld_safe --user=mysql &
- cp support-files//mysql.server /etc/rc.d/init.d/mysqld
-
service mysqld start
- bin/mysql -u root -p
- alter user 'root'@'localhost' identified by '新密码';