mysql8.0安装 修改密码及加密方式

1、官网下载:https://dev.mysql.com/downloads/mysql/

2、解压

3、管理员运行cmd cd到安装bin目录

4、初始化  记住初始密码

mysqld --initialize --console

5、安装

mysqld install

6、启动

net start mysql

7、登录

mysql -u root -p

8、修改密码

ALTER USER 'root'@'localhost' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
flush privileges;

 9、客户端无法连接

Client does not support authentication protocol requested by server; consider upgrading MySQL client 

 select user, host, plugin, authentication_string from user\G;查看加密方式

8.0加密方式(caching_sha2_password)有些客户端还不支持 所以使用mysql_native_password加密

ALTER USER 'root'@'localhost' IDENTIFIED with mysql_native_password BY '123456' PASSWORD EXPIRE NEVER;

你可能感兴趣的:(SQL)