linux ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
时间: 2023-09-08 17:11:50 浏览: 184
在Linux中,当出现"ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)"错误时,这通常是因为使用了错误的用户名或密码,或者没有输入密码。
引用提到,如果Host不是localhost,即使密码修改成功,也无法在本机进行登录,会报错"ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)"。这意味着在尝试登录时,使用了错误的用户名或密码。
引用提到解决方法之一是打开mysqld.cnf文件,该文件位于创建mysql容器时挂载的conf目录下。在该文件中,可以查看是否存在错误的用户名或密码,并进行修改。
引用提到,在下载完mysql之后,想要设置密码时,输入"/usr/bin/mysqladmin -u root -p '123456'"之后出现了"ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)"错误。解决方案之一是使用免密登录MySQL的方式。
综上所述,当出现"ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)"错误时,可能是由于用户名或密码错误导致的,也可能是使用了免密登录MySQL的方式。请仔细检查用户名和密码是否正确,并考虑使用正确的登录方式。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Linux的mysql报ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO/...](https://blog.csdn.net/YoYoQqq/article/details/124779636)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [连腾讯云上的docker上的mysql报错ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ ...](https://download.csdn.net/download/weixin_38732519/14074606)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Linux解决MySQL登录ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor)问题](https://blog.csdn.net/okakio/article/details/102743484)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]