日期:2014-05-16  浏览次数:20815 次

解决mysql登录异常(1045问题)
手动删除mysql残留服务
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysqld -remove mysql
Service successfully removed.


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



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
1 楼 zhangchengchao 2011-08-23