---
title: "Mysql“using password: YES”的解决"
author: "crane.ding"
date: "2014-11-15T14:57:31Z"
tags: []
categories: ["数据库"]
slug: "mysql-using-password-yes"
draft: false
lastmod: "2014-11-15T14:57:31Z"
id: 2156503
url: "https://crane-ding.iteye.com/blog/2156503"
---

错误代码 1045
Access denied for user 'root'@'localhost' (using password:YES)

解决方法：重置root用户密码

```sql

ps -ef | grep -v grep | grep  mysql | awk '{print $2}' | xargs kill -9
mysqld_safe --skip-grant-tables &
mysql -uroot -p
update user set password=password('123456') where user = 'root';

```