一、下载
mysql.com
二、解压,并创建my.ini配置文件
[mysqld]
default_authentication_plugin=mysql_native_password
character_set_server = utf8mb4
collation_server=utf8mb4_general_ci
[client]
default-character-set=utf8mb4
三、初始化data目录,并记录密码
mysqld.exe --initialize --console
四、创建win服务,并启动Mysql
mysqld.exe --install
net start mysql
修改root密码
mysql -uroot -p
#输入第三步记录的密码
alter user 'root'@'localhost' identified with mysql_native_password by'root';
flush privileges;
参考:https://dev.mysql.com/doc/refman/8.0/en/windows-install-archive.html