---
title: "解决mysql登录异常（1045问题）"
author: "cnyangqi"
date: "2011-08-23T21:28:04Z"
tags: []
categories: ["编程语言"]
slug: "mysql-1045"
draft: false
lastmod: "2011-08-23T22:19:08Z"
id: 1156334
url: "https://yangq.iteye.com/blog/1156334"
---

手动删除mysql残留服务

```dos

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysqld -remove mysql
Service successfully removed.

```



```dos

net stop mysql

C:\Program Files\MySQL\MySQL Server 5.5\bin>mysqld --defaults-file="C:\Program F
iles\MySQL\MySQL Server 5.5\my.ini" --console --skip-grant-tables

```



```dos


C:\Documents and Settings\Administrator>mysql -u root mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.15 MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

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.

mysql>  update user set password=password('12345678') where user='root';
Query OK, 0 rows affected (0.06 sec)
Rows matched: 3  Changed: 0  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> quit
Bye

```