命令行启动mysql被拒绝(windows)

需要以管理员身份运行cmd进入,使用命令net start mysql启动

使用命令net stop mysql 停止。

mysql忘记密码,解决方法:

在mysql安装目录下my.ini中加上skip-grant-tables,然后重启mysql服务

命令行输入 mysql -u root -p,直接确认可以免密码登录,然后重设密码

update mysql.user set authentication_string='这里填写你要设置的密码'  where user='root';

然后注释掉skip-grant-tables,然后再重启mysql服务

猜你喜欢

转载自my.oschina.net/quanbaishuai/blog/1816934