一、免密登录,密码置空
net stop mysql
# 窗口1
mysqld --console --skip-grant-tables --shared-memory
# 窗口2
mysql -u root -p (直接回车)
use mysql;
# 修改密码为空
update user set authentication_string='' where user='root';
FLUSH PRIVILEGES;
exit;
二、修改密码
# 关闭窗口1
# 关闭mysql
net stop mysql
# 启动
net start mysql
# 直接回车
mysql -u root -p
# 修改密码
alter user 'root'@'localhost' identified with mysql_native_password by '123456';
# 退出
exit;
mysql -uroot -proot
以下操作时mysql安装卸载
安装mysql
下载zip文件,解压
进入bin文件夹
//安装mysql 安装完成后Mysql会有一个随机密码
mysqld --initialize --console
//安装mysql服务并启动
mysqld --install mysql
接着,去服务中,启动mysql服务
删除mysql
停止mysql
net stop mysql
sc delete MySQL