注:
在 my.ini 下添加 skip-grant-tables
, 可免密登录
设置密码
D:mysql-5.7.35bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。D:mysql-5.7.35bin>mysql -u root -p
Enter password: # 此处直接回车,不输入密码
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.7.35 MySQL Community Server (GPL)Copyright (c) 2000, 2021, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or 'h' for help. Type 'c' to clear the current sql> update mysql.user set authentication_string=password('123456') where user='root' and Host ='localhost';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
host:确定要操作的数据库在哪台电脑上,比如上图的localhost代表的是本机,如果要操作的是别人的电脑,就需要输入其他的IP地址
skip-grant-tables
mysql> exit
ByeD:mysql-5.7.35bin>net stop mysql
MySQL 服务正在停止.
MySQL 服务已成功停止。D:mysql-5.7.35bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
本文发布于:2024-02-03 06:11:14,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170691187449156.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |