win11 安装绿色版 mysql-8.0.21
2020-11-21
tools
下载安装包mysql-8.0.21-winx64.zip并解压。
初始化mysql
进入bin目录执行初始化命令,执行完成后将生成data目录,默认初始化完成后使用root账号登入是不需要密码的。
mysqld --initialize-insecure --user=mysql
将mysql安装成服务,注意需要使用管理员权限
mysqld install
设置root账号密码
仍然使用以下命令启动mysql,免密码登录
mysqld --console
使用命令mysql登入,完成设置root账号密码
mysql -u root
修改密码,如遇到is running with the --skip-grant-tables option so it cannot execute,先执行flush privileges;
alter user root@localhost identified with mysql_native_password by 'root123123';
flush privileges;
