./bin/mysqld --user=root --initialize
cd support-files/
先修改MySQL路径
vim /etc/profile
export PARH=$PATH:/home/lxz/mysql-8.0.37/bin:
export PARH=$PATH:/home/lxz/mysql-8.0.37/support-files
export PARH=$PATH:/home/lxz/mysql-8.0.37/lib
source /etc/profile
./mysql.server start --user=root
alter user 'root'@'localhost' identified with mysql_native_password by '123456';
CREATE USER 'root'@'%' IDENTIFIED with mysql_native_password BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
alter user 'root'@'localhost' identified by '123456';
CREATE USER 'root'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
alter user 'root'@'%' identified with mysql_native_password by '123456';