1.首先在my.ini中加入skip-grant-tables免密登录
2.登录mysql -uroot -p密码为空
3.选择数据库use mysql
4.update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';
5.mysql> flush privileges;//刷新
6.mysql> quit;
7.alter user 'root'@'localhost' identified by '123456'; 如果不修改不能登录mysql
今天工作需要重新安装mysql,看到网上最新的是5.7.9,就下了个安装。走到net start mysql 启动服务这步时,老是报错3534。
解决方案:
mysqld --romve 删除mysql服务
mysqld --install 安装mysql服务
mysqld --initialize 一定要初始化
net start mysql