groupadd mysql

useradd -g mysql mysql

wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.15-el7-x86_64.tar

tar -xvf mysql-8.0.15-el7-x86_64.tar

tar -zxvf mysql-8.0.15-el7-x86_64.tar.gz

yum install lrzsz make cmake g++ git vim gcc libncurses5-dev bison

mv mysql-8.0.15-el7-x86_64 /usr/local/servers/mysql

cd /usr/local/servers/mysql/bin

./mysqld --initialize --user=mysql --console

## 此时会提示有一个临时root密码

./mysqld_safe --user=mysql &
#启动后进去改root密码

 

ALTER USER 'root'@'localhost' identified by 'password' ;

sqlyog登录报错

ALTER USER 'user'@'host' identified by 'password' PASSWORD EXPIRE NEVER;
ALTER USER 'user'@'host'  IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
ALTER USER 'user'@'host' identified by 'password';