win7上SQLyog登入本地mysql提示:1045 access denied for user'root'@'localhost'

来源:互联网 发布:poi java解析excel 编辑:程序博客网 时间:2024/04/29 21:12
 1、打开DOS进入mysql下bin目录:本人:C:\Program Files\MySQL\MySQL Server 5.1\bin
 2、停止mysql服务,net stop  mysql

 3、在C:\Program Files\MySQL\MySQL Server 5.1\bin后面输入:mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server        \my.ini" --console --skip-grant-tables


Version: '5.1.33-community-log'  socket: ''  port: 3306  MySQL Community Server
(GPL)

4.看到这个结果就说明MySQL已经起来了。
再开一个DOS窗口,同样切到mysql bin目录下,
C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -uroot mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.33-community-log MySQL Community Server (GPL)

5.

mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’; 
mysql> FLUSH PRIVILEGES; 
mysql> quit 

1 0
原创粉丝点击