1、下载mysql
下载地址:MySQL :: Download MySQL Community Server (Archived Versions)
2、解压mysql
3、打开cmd,进入mysql解压路径下的bin路径
4、执行mysqld install
5、执行mysqld --initialize
6、执行net start mysql
7、进入解压路径下的data/PC-20240226JYFH.err,搜索password,会找到
A temporary password is generated for root@localhost: xxxxxx(就是mysql为root用户生成的默认密码)
8、执行mysql -urrot -p,输入密码
9、修改密码:
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
10、flush privileges
11、quit
12、登陆navicat验证密码