Some problems of mysql

本文将指导您解决MySQL中常见的'access denied for user root@localhost'问题,通过分步骤操作,修改root用户的密码,从而解决访问拒绝的问题。包括停止MySQL服务、进入安全模式、修改root密码等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

This post is about some problems of mysql.

1.access denied for user root@localhost(using password no)

Reason: all kinds of problems.

Solution: modify the password according to the following steps.

step 1) Stop the mysql service.

Open the command prompt window and input the command "net stop mysql". or you can stop the service in the services.msc.

step 2) entry the security mode of mysql.

entry the bin directory of mysql's installation and input the command "mysqld-nt --skip-grant-tables" and don't close this window.

step 3) modify the root's password.

3.1. open the new command prompt window and input the command "mysql -uroot -p" and entry the "enter" without the password.

3.2. input the command "update mysql.user set password=PASSWORD('new password') where User='root';"

3.3. fresh the privileges table

input the command "flush privileges;" and quit mysql.

Step 4) restart the mysql service.

2.access denied for user root@localhost(using password yes)

Reason: the password you input was wrong.

Solution: input the right password or modify the password according to the above step.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值