网站建设要学编程吗,网站建设 - 碧诺网络,好听的工程公司名字,成都网站建设推来客Mysql 5.7重置root密码
如果您忘记了MySQL 5.7的root密码#xff0c;可以通过以下步骤重置#xff1a; 停止MySQL服务。在命令行中输入以下命令#xff1a;
systemctl stop mysqld启动MySQL服务并跳过授权表。在命令行中输入以下命令#xff1a;
mysqld_safe --skip-gra…Mysql 5.7重置root密码
如果您忘记了MySQL 5.7的root密码可以通过以下步骤重置 停止MySQL服务。在命令行中输入以下命令
systemctl stop mysqld启动MySQL服务并跳过授权表。在命令行中输入以下命令
mysqld_safe --skip-grant-tables 以root用户登录MySQL。在命令行中输入以下命令
mysql选择mysql数据库。输入以下命令
use mysql;重置root密码。将your_new_password替换为您想要设置的新密码然后输入以下命令
update user set authentication_stringPASSWORD(your_new_password) where Userroot;刷新权限。输入以下命令
flush privileges;退出MySQL。输入以下命令
quit;停止MySQL服务。在命令行中输入以下命令
systemctl stop mysqld重新启动MySQL服务。在命令行中输入以下命令
systemctl start mysqld现在已经成功重置了MySQL 5.7的root密码,能正常登录mysql了。
[roottest mysql]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.38-log MySQL Community Server (GPL)Copyright (c) 2000, 2022, 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.