多实例:
mysqld install MySQL80-3316 --defaults-file="D:softwaremysql-8.0.16-winx64my.ini
初始化后会生成data文件和一个密码
打开注册表,HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMySQL80-3316,把里面的ImagePath改为以下参数:
"D:softwaremysql-8.0.16-winx64inmysqld" --defaults-file=D:softwaremysql-8.0.16-winx64my.ini MySQL80-3307
启动服务:net start MySQL80-3307
修改密码:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
刷新权限:flush privileges;
Unable to load authentication plugin 'caching_sha2_password'.错误解决:
5.X版本是:default_authentication_plugin=mysql_native_password
8.x版本就是:default_authentication_plugin=caching_sha2_password
输入如下代码:(password换成相应密码)
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
alter user 'root'@'localhost' identified by 'password';
参考博客:https://www.cnblogs.com/wanguncle/p/11432868.html