1.看了网上说是没给root权限,又要我登录mysql改密码
2.网上也是sb没权限怎么登录,然后我找到了一个直接不要密码的登录方法
1.首先到安装mysql目录找到my.ini文件,然后记事本打开
2.在最后一行加上
skip-grant-tables
3.在打开windows服务重启mysql服务
4.cmd然后mysql -u root -p 不用输入密码就直接回车进去了,前提是配置了环境变量
5.进入后先use mysql;
5.然后输入update MySQL.user set password=password(‘123456’) where user=‘root’;
6.mysql5.7的不是password,是authentication_string
update MySQL.user set authentication_string=password(‘123456’) where user=‘root’;
7.输出Query OK就行了
8.然后删除skip-grant-tables,重启mysql服务,用root和你自己配置的密码即可登录