1. cd /opt
2. wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.26-linux-glibc2.17-x86_64-minimal-rebuild.tar
3. tar xvf mysql-8.0.26-linux-glibc2.17-x86_64-minimal-rebuild.tar
4. tar xvf mysql-8.0.26-linux-glibc2.17-x86_64-minimal-rebuild.tar.xz
5. mv mysql-8.0.26-linux-glibc2.17-x86_64-minimal-rebuild mysql-8.0
6. groupadd mysql
7. useradd -g mysql mysql
8. chown -R mysql:mysql /opt/mysql-8.0
9. cd mysql-8.0/bin
10. ./mysqld --user=mysql --basedir=/opt/mysql-8.0 --datadir=/opt/mysql-8.0/data --initialize
11. vim /etc/my.cnf
[mysqld]
datadir=/opt/mysql-8.0/data
basedir=/opt/mysql-8.0
socket=/tmp/mysql.sock
12. cp /opt/mysql-8.0/support-files/mysql.server /etc/init.d/mysql
13. chkconfig --add mysql
14. service mysql start
14 ln -s /opt/mysql-8.0/bin/mysql /usr/bin/
15 mysql -u root -p
16 ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
17 flush privileges;