解决Can't connect to MySQL server on 'localhost' (10061)"

admin 评论 mysql

以前用的mysql5.0.45安装版的,用了一段时间以后重启服务器就连不上了,在服务里看还是运行着的,怎么都连不上数据库。没有办法卸载重新安装吧,可是到最后一步的时候怎么都过不去了,网上的解决方法也不行。又下了免安装版的5.1.6,第一次运行可以用,可是重启服务器又不行了,状态和安装版的一样,后来在mysql官方论坛看到了一个高手的解决办法,现提供在此以备用。ai2林心小筑

Thank you for the bug report. Sorry but this isn't bug, try the below steps:ai2林心小筑

1- Be sure using the Task manager none mysqld process is running as service.ai2林心小筑
2- Open a DOS prompt and go the install \bin directory.ai2林心小筑
3- Run the below command:
ai2林心小筑

   mysqld-nt --standalone --consoleai2林心小筑
4- Open another DOS prompt and go too to the \bin directory.ai2林心小筑
5- Run the below command:
ai2林心小筑

   mysql -uroot -pai2林心小筑

you will see something like below:ai2林心小筑

c:\mysql\bin>mysql -uroot -pai2林心小筑
Enter password:ai2林心小筑
Welcome to the MySQL monitor.  Commands end with ; or \g.ai2林心小筑
Your MySQL connection id is 18 to server version: 5.0.22
ai2林心小筑

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.ai2林心小筑

mysql>ai2林心小筑

You need to provide a password if you during the install had configuredai2林心小筑
the root privileges or empty otherwise.
ai2林心小筑

就是不用安装在服务里,直接在mysql命令后面加上参数用dos窗口运行。ai2林心小筑

就是mysqld-nt --standalone --consoleai2林心小筑
ai2林心小筑

向作者提问
 
顶() 踩()

  • 说点什么