网站建设swot市场分析,基于MVC网站建设课程设计报告,seo新人培训班,重庆房地产信息官网方法一#xff1a;通用方法--启动时跳过权限表
1 停止数据库
以管理员方式打开cmd#xff01;#xff01; C:\Users\Administratornet stop mysql MySQL 服务正在停止..
MySQL 服务已成功停止。
2 启动时跳过权限表 mysqld --console --skip-grant-tables -…方法一通用方法--启动时跳过权限表
1 停止数据库
以管理员方式打开cmd C:\Users\Administratornet stop mysql MySQL 服务正在停止..
MySQL 服务已成功停止。
2 启动时跳过权限表 mysqld --console --skip-grant-tables --shared-memory C:\Users\Administratormysqld --console --skip-grant-tables --shared-memory
注意不要关闭终端 3 重开新的终端再开一个终端登录并设置新密码 PS C:\Users\Administrator mysql -uroot -p Enter password: 直接敲回车键 mysql flush privileges; mysql alter user rootlocalhost identified by 123456; //重置密码 4 退出MySQL关闭第一个终端正常启动服务。
mysql \q PS C:\Users\Administrator net start mysql MySQL 服务正在启动 ..
MySQL 服务已经启动成功。 PS C:\Users\Administrator mysql -uroot -p123456 mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.36 MySQL Community Server - GPL
Copyright (c) 2000, 2024, 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 input statement. mysql \q
Bye
方法二参考官方文档
1 停止服务 PS C:\Users\Administrator net stop mysql MySQL 服务正在停止.
MySQL 服务已成功停止。
2 创建一个文本文件到mysql文件夹里保存为 mysql_init.txt 内容如下 ALTER USER rootlocalhost IDENTIFIED BY 123456; 3 启动同时使用上一步文件修改密码
要求管理员身份打开cmd来运行命令暂时不要关闭终端
C:\Users\Administratormysqld --init-file F:\mysql\mysql-8.0.36-winx64\mysql_init.txt
具体路径复制粘贴
4 打开另一个终端登录测试 PS C:\Users\Administrator mysql -uroot -p123456 mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.36 MySQL Community Server - GPL
Copyright (c) 2000, 2024, 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 input statement.
mysql \q
Bye
5 关闭第一个终端正常启动服务。 C:\Users\Administratornet start mysql MySQL 服务正在启动 ..
MySQL 服务已经启动成功。 C:\Users\Administratormysql -uroot -p123456 mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.36 MySQL Community Server - GPL
Copyright (c) 2000, 2024, 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 input statement.
mysql \q
Bye 6 删除文件 mysql_init.txt