林心小筑

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

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

Thank you for the bug report. Sorry but this isn't bug, try the below steps:

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

   mysqld-nt --standalone --console
4- Open another DOS prompt and go too to the \bin directory.
5- Run the below command:

   mysql -uroot -p

you will see something like below:

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

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

You need to provide a password if you during the install had configured
the root privileges or empty otherwise.

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

就是mysqld-nt --standalone --console

此文由 林心小筑 编辑,未经允许不得转载!:首页 > 潮·科技 » 解决Can't connect to MySQL server on 'localhost' (10061)"

()
分享到:

相关推荐