错误号码1045 Access denied for user 'root'@'192.168.73.129' (using password:YES)
时间: 2023-12-15 07:33:22 浏览: 105
错误号码1045 Access denied for user 'root'@'192.168.73.129' ( password:YES)表示使用root用户连接MySQL时被拒绝了。这可能是由于密码错误或权限不足引起的。以下是两种可能的解决方法:
1.检查密码是否正确。如果您忘记了密码,可以尝试重置密码。可以使用以下命令重置密码:
```shell
sudo /etc/init.d/mysql stop
sudo mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set authentication_string=password('new_password') where user='root';
flush privileges;
quit;
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start
```
其中,将“new_password”替换为您想要设置的新密码。
2.检查用户权限。如果密码正确但仍然无法连接,请检查用户是否具有足够的权限。可以使用以下命令检查用户权限:
```shell
mysql -u root -p
show grants for 'root'@'192.168.73.129';
```
如果用户没有足够的权限,请使用以下命令为用户授予所需的权限:
```shell
mysql -u root -p
grant all privileges on *.* to 'root'@'192.168.73.129' identified by 'password';
flush privileges;
```
其中,“password”是您为用户设置的密码。
阅读全文
相关推荐


















