|
发表于 2007 年 4 月 29 日 16:37:34
|
显示全部楼层
![【腾讯云】2核2G云服务器新老同享 99元/年,续费同价](https://jgwy.net/data/attachment/common/cf/090515m4dy7z45qqoqap50.png)
我的mysql为MySQL - 5.0.23:
1、在开始菜单“运行”栏里输入“CMD”,进入到了命令行下
C:\Documents and Settings\millken>
C:\Documents and Settings\millken>net stop mysql
C:\Documents and Settings\millken>mysqld-nt --skip-grant-tables
C:\Documents and Settings\millken>
2、新开一个CMD窗口:
*************************************************************************
Microsoft Windows [版本 5.2.3790]
(C) 版权所有 1985-2003 Microsoft Corp.
C:\Documents and Settings\millken>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18 to server version: 5.0.23-community-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use mysql
Database changed
mysql> update user set password=password("root") where host="localhost" and user="root";
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
mysql> set password for "root"@"localhost"=old_password("root");
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables
option so it cannot execute this statement
mysql> exit;
Bye
C:\Documents and Settings\millken>d:
D:\>mysqladmin -u root shutdown
D:\>net start mysql
MySQL 服务已经启动成功。
D:\>cd www
D:\WWW>cd mysql
D:\WWW\MYSQL>cd bin
D:\WWW\MYSQL\bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 35 to server version: 5.0.23-community-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> set password for 'root'@'localhost'=old_password("root");
Query OK, 0 rows affected (0.00 sec)
mysql>
至此就大功告成了,注意一点的是因为5.0.1版Mysql的password算法和3.23.44的算法不一样了,所以要运行最后一句,不然phpmyadmin下会进不了。
LINUX下大致一样,就是命令稍有不同 |
|