猜想可能是服务未启动,启动
MySQL
服务
先执行 mysqld --install ,再执行 net start mysql
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqld-nt --skip-grant-tables
111230 10:45:14 [ERROR] Can't find messagefile 'D:\Program Files\MySQL\MySQL Server 5.0\share\english\errmsg.sys'
111230 10:45:14 [ERROR] Aborting
解决方法:将 MySQL Server\bin 下的 my.ini 删除或修改 ( 我将其改了个名字,后来 MySQL 数据库可用之后,我又将其还原了 ) ,再执行:
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqld-nt --skip-grant-tables
开启另一个 cmd 窗口,输入 mysql
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql
修改密码
mysql> use mysql
mysql> update user set password=password("123456")
-> where user ="root";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings:
先执行 mysqld --install ,再执行 net start mysql
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqld-nt --skip-grant-tables
111230 10:45:14 [ERROR] Can't find messagefile 'D:\Program Files\MySQL\MySQL Server 5.0\share\english\errmsg.sys'
111230 10:45:14 [ERROR] Aborting
解决方法:将 MySQL Server\bin 下的 my.ini 删除或修改 ( 我将其改了个名字,后来 MySQL 数据库可用之后,我又将其还原了 ) ,再执行:
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqld-nt --skip-grant-tables
开启另一个 cmd 窗口,输入 mysql
C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql
修改密码
mysql> use mysql
mysql> update user set password=password("123456")
-> where user ="root";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings:
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10314474/viewspace-714870/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/10314474/viewspace-714870/