好久没用mysql了,这次又装了一个小系统,改了root密码以后,发现没啥用,还是用空密码就能登录。
update user set password=password('gaj123456') where user='root' and host='localhost';
update user set password=password('gaj123456') where user='root' and host='127.0.0.1';
然后才发现,要重启服务。
cmd执行以下语句:
net stop mysql;
net start mysql;
成功。
写个小博客,省的自己忘记。