MySQL Workbench 5.2 CE,Windows 7,“无法连接到 127.0.0.1 (10061) 上的 MySQL 服务器”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17227037/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MySQL Workbench 5.2 CE, Windows 7, "Can't connect to MySQL Server on 127.0.0.1 (10061)"
提问by Angelo Rivera
I've seen this problem asked a bunch of times on here but every solution posted hasn't been helpful for me.
我已经看到这个问题在这里问了很多次,但发布的每个解决方案对我都没有帮助。
I just got the x86 install and installed MySQL Workbench 5.2 CE on my Computer.
我刚刚在我的计算机上安装了 x86 并安装了 MySQL Workbench 5.2 CE。
After that I tried to create a New Server Instance or New Connection using localhost as the hostname, I've tried Port 3306 (and trying no port) and not putting a password for root or Default Schema.
之后,我尝试使用 localhost 作为主机名创建新服务器实例或新连接,我尝试了端口 3306(并且不尝试任何端口)并且没有为 root 或默认架构设置密码。
I get the error message "Can't connect to MySQL server on '127.0.0.1' (10061)" both times.
我两次都收到错误消息“无法连接到'127.0.0.1'(10061)上的MySQL服务器”。
I read a possible problem is that the MySQL Server isn't running so I tried looking for mysqld in my MySQL Workbench 5.2 CE folder but it isn't there (there isn't a bin folder either).
我读到一个可能的问题是 MySQL 服务器没有运行,所以我尝试在我的 MySQL Workbench 5.2 CE 文件夹中查找 mysqld,但它不存在(也没有 bin 文件夹)。
It's frustrating since all I want to do is create a small application that connects to MySQL Workbench for a school project (though I may use MySQL later on).
这很令人沮丧,因为我只想创建一个连接到 MySQL Workbench 用于学校项目的小应用程序(尽管我以后可能会使用 MySQL)。
Any help would be very much appreciated. Thanks.
任何帮助将不胜感激。谢谢。
回答by Gyan Veda
I had the same problem and solved it as follows.
我遇到了同样的问题,并按如下方式解决了它。
- Search for 'Services' in the Windows Search Bar.
- Click on 'Services', which should be the only hit.
- Scroll down to 'MySQL56'.
- Right-click on this item and hit 'Start' or 'Restart'.
- 在 Windows 搜索栏中搜索“服务”。
- 点击“服务”,这应该是唯一的点击。
- 向下滚动到“MySQL56”。
- 右键单击此项目并点击“开始”或“重新启动”。
That's it! Easy as pie.
就是这样!非常简单。
回答by user2339071
It is indeed the case that your MySQL Server isn't running. bin is not in Workbench, its in MySQL Server directory. To start the MySQL Server ( I am assuming default installation path).
确实是您的 MySQL 服务器没有运行的情况。bin 不在 Workbench 中,它在 MySQL Server 目录中。启动 MySQL 服务器(我假设默认安装路径)。
Open command prompt. Navigate to MySQL server directory using command prompt.
打开命令提示符。使用命令提示符导航到 MySQL 服务器目录。
C:\cd Program Files\MySQL\MySQL Server 5.X\bin
Once inside bin type in:
进入 bin 后输入:
C:\Program Files\MySQL\MySQL Server 5.X\bin :> mysqld --console
The SQL Server will start-up. Do not close this command prompt. Use Workbench utilities as you usually do in another command prompt.
SQL Server 将启动。不要关闭此命令提示符。像通常在另一个命令提示符中一样使用 Workbench 实用程序。
If this doesn't work make sure you have MySQL Server installed on your system as Workbench is just a front end.
如果这不起作用,请确保您的系统上安装了 MySQL 服务器,因为 Workbench 只是一个前端。
回答by Tower Jimmy
I had the same problem.
我有同样的问题。
The problem is you installed the Workbench but not the Server. Moreover you have to configure the server first before you can connect to it.
问题是您安装了 Workbench 而不是服务器。此外,您必须先配置服务器,然后才能连接到它。
Long story short: Install this installer: http://dev.mysql.com/downloads/windows/installer/
长话短说:安装这个安装程序:http: //dev.mysql.com/downloads/windows/installer/
Check everything/install all options and you will be guided through a wizard. You can set up a root username and a password and you are ready to go to use the Workbench.
检查所有内容/安装所有选项,您将通过向导获得指导。您可以设置 root 用户名和密码,然后就可以开始使用 Workbench。
Uninstall whatever you have installed so far.
卸载您迄今为止安装的任何内容。
回答by ObviousChild
if you have used msi installer or exe to install mysql in windows, you can start the service from services.msc
如果你在windows下用msi installer或者exe安装过mysql,可以从services.msc启动服务
if you have just unzipped mysql from somewhere, service won't be available to start from services.msc. In this case start the server using mysqld.exe
如果您刚刚从某处解压缩了 mysql,则无法从 services.msc 启动服务。在这种情况下使用 mysqld.exe 启动服务器
回答by togu
I had the same Problem.
我有同样的问题。
I think the Problem showed because I did not create a specific userfor the Database during the configuration while installing everything. Thought i could do it later. I only entered a server password.
我认为问题显示是因为我在安装所有内容时没有在配置期间为数据库创建特定用户。以为我以后可以做到。我只输入了服务器密码。
After re-installation and creating an user during the installation everything works now.
重新安装并在安装过程中创建用户后,一切正常。
回答by tanya nash
I had the same issue on my laptop install (running windows 8.1) and my desktop (running windows 7). Both are 64bit.
我在我的笔记本电脑安装(运行 Windows 8.1)和我的桌面(运行 Windows 7)上遇到了同样的问题。两者都是64位。
I had not used MySQL workbench on either system for over a year they were updated from versions 5.1 and 5.4 to MySQL Workbench V6.3CE I never did get the newer 6.3 version to update after countless hours researching potential known compatibility issues, any update release issues ect. (note: V6.3 ce did work on both systems the last time they were used so I was really baffled at what had happened.
我已经一年多没有在这两个系统上使用 MySQL Workbench 他们从版本 5.1 和 5.4 更新到 MySQL Workbench V6.3CE 在无数小时研究潜在的已知兼容性问题,任何更新发布问题后,我从未得到更新的 6.3 版本等。(注意:V6.3 ce 上次使用时确实在这两个系统上都有效,所以我对发生的事情感到非常困惑。
Here is what I did to solve the issue and get up and running with MySQL Server and MySQL Workbench.
这是我为解决该问题并启动并运行 MySQL Server 和 MySQL Workbench 所做的工作。
-Backed up all db schemas
-Deleted MySQl WorkBench and any versions of MySQL Server vX.x via the control panel
-Deleted the ALL associated folders from C:\Program Files, from C:\Program Files (x86), from C:\ProgramData (-this is a hidden file) (This is the only complete uninstall)
-Go to Control Panel> System> Administrative > Services and look for your MySQL instance to be sure it's no listed. If it is you still have files and/or folders on your hard drive that need to be deleted and it may still be Running.
-Run CMD as administrator [ C:\Windows\System32> ]
use statement: Net MYSQL
and then statement: sc delete
This deletes all installs of MYSQl Server.
-Restart
-Re- Install I chose to use the earlier versions (MySQL Server 5.4 beta) first so that the config wizard runs and (MySql Workbench 5.2 CE) only because I wanted to get it up and running to create a restore point before any upgrade.
After all of that I have both systems running and connecting with no errors, I was able to create my user accounts and adjust privileges during the connection creations. I assume at some point I will have to upgrade but not until this no longer works. Hope this helps as a one stop answer ( I visited at least 20 different topics nailed down what was missing from the previous upgrade installs.
- 备份所有数据库架构 -
通过控制面板删除 MySQl WorkBench 和任何版本的 MySQL Server vX.x -
从 C:\Program Files、C:\Program Files (x86)、C:\删除所有相关文件夹ProgramData(-这是一个隐藏文件)(这是唯一完整的卸载)-
转到控制面板> 系统> 管理> 服务并查找您的 MySQL 实例以确保它未列出。如果是这样,您的硬盘驱动器上仍有需要删除的文件和/或文件夹,并且它可能仍在运行。
- 以管理员身份运行 CMD [ C:\Windows\System32> ]
使用语句:Net MYSQL
然后语句:sc delete
这将删除 MYSQl Server 的所有安装。
-重新开始
-重新安装 我选择首先使用早期版本(MySQL Server 5.4 beta)以便配置向导运行和(MySql Workbench 5.2 CE)只是因为我想在任何升级之前启动并运行它以创建还原点。
在这一切之后,我的两个系统都在运行并且连接没有错误,我能够在创建连接期间创建我的用户帐户并调整权限。我假设在某个时候我将不得不升级,但直到这不再有效为止。希望这有助于作为一站式答案(我访问了至少 20 个不同的主题,确定了以前升级安装中缺少的内容。
回答by saneryee
Like this.
像这样。
$ sudo vim /etc/mysql/my.cnf
#bind-address = XXX.XXX.XXX.XXX
$ sudo vim /etc/mysql/my.cnf
#bind-address = XXX.XXX.XXX.XXX
回答by Hamid Hoseini
Following command worked for me. Try it:
以下命令对我有用。尝试一下:
C:\wamp\bin\mysql\mysql5.6.17\bin\mysqld.exe --console
you should find mysqld.exe
in your computer and then run it manually.
您应该mysqld.exe
在您的计算机中找到然后手动运行它。
回答by dsk
Go to C:\cd Program Files\MySQL\MySQL Server 5.X\bin directory and run file "MySQLInstanceConfig.exe"
转到 C:\cd Program Files\MySQL\MySQL Server 5.X\bin 目录并运行文件“MySQLInstanceConfig.exe”
and set port to 10061
并将端口设置为 10061
回答by owelchez
Sorry to bump an old question, I was having the same problem as OP, to fix this problem all I did was to download the MSI Installer and only reinstalled the server and went through the configuration which is pretty straightforward.
很抱歉提出一个老问题,我遇到了与 OP 相同的问题,为了解决这个问题,我所做的只是下载 MSI 安装程序,然后只重新安装服务器并完成非常简单的配置。