安装后无法在“localhost”(10061)上连接到MySQL服务器

时间:2021-09-12 00:43:02

I installed MySQL using mysql-installer-5.5.20.0.msi on Windows 7. From the cmd window, I run "mysqlshow -u root -p". It asked for a password, then returned this error: "Can't connect to MySQL server on 'localhost' (10061)" This is a bad indication of partially failed/successful installation.

我使用MySQL -installer- 5.20.0安装了MySQL。msi在Windows 7。在cmd窗口中,我运行“mysqlshow -u root -p”。它询问密码,然后返回这个错误:“无法在'localhost'(10061)上连接到MySQL服务器”这是部分失败/成功安装的不好的标志。

After reading the page, http://dev.mysql.com/doc/refman/5.5/en/windows-troubleshooting.html, it told me to find an error log (.err) in C:\Program Files\MySQL\MySQL Server 5.5\data. The directory exists but there is no log file.

在阅读页面http://dev.mysql.com/doc/refman/5.5/en/windows-troubleshooting.html,它告诉我要找到一个错误日志(.err)C:\Program Files\MySQL\MySQL Server 5.5 \数据。该目录存在,但没有日志文件。

I have a feeling this is related to the tight security of Windows 7, especially when installing a Unix based software. And yes, I am the Administrator on my PC.

我觉得这与Windows 7的严格安全性有关,尤其是在安装基于Unix的软件时。是的,我是我电脑上的管理员。

Any help or suggestions is appreciated. And I can return a favor by answering Java and SQL query questions.

欢迎任何帮助或建议。我也可以通过回答Java和SQL查询问题来回报您的帮助。

16 个解决方案

#1


20  

this issue is very to solve by windows server users

这个问题很容易被windows服务器用户解决

  1. go to this path C:\Program Files\MySQL\MySQL Server 5.1\bin

    去这条路C:\Program Files\MySQL\MySQL Server 5.1 \ bin

  2. run this tool "MySQLInstanceConfig.exe"

    运行此工具“MySQLInstanceConfig.exe”

and config the instatnce again and problem solved

并重新配置状态,解决了问题

#2


13  

Please Try the following steps:

请尝试以下步骤:

  1. c:\mysql\bin>mysqld --install
  2. c:\ mysql \ bin > mysqld——安装
  3. c:\mysql\bin>mysqld --initialize
  4. c:\ mysql \ bin > mysqld——初始化

then press "Windows key + R" write "services.msc", run as admin

然后按“Windows key + R”write服务。msc”,作为管理员运行

start MySQL service.

启动MySQL服务。

#3


12  

The simple solution that worked for me is: change localhost to 127.0.0.1 in your database.yml or in your script if writing one.

对我来说,最简单的解决方案是:将数据库中的localhost更改为127.0.0.1。动笔或写在你的剧本里。

#4


8  

I also faced the same issue and resolved it by below setups:

我也遇到了同样的问题,通过下面的设置来解决:

  1. Check the MYSQL service in the windows service. If it is there and not running then start it. It will solve your problem.
  2. 检查windows服务中的MYSQL服务。如果它在那里而没有运行,那么就启动它。它会解决你的问题。

安装后无法在“localhost”(10061)上连接到MySQL服务器

  1. If MYSQL service is not present in windows service then follow below setups.

    如果在windows服务中没有MYSQL服务,请遵循以下设置。

    a. Open cmd as administrator.

    a.以管理员身份打开cmd。

    b. cd to C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin

    b . cd C:\Program Files (x86)\MySQL\MySQL Server 5.6 \ bin

    c. Run the command: C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>mysqld.exe --install

    c。运行该命令:C:\Program Files (x86)\MySQL\MySQL Server 5.6 \ bin mysqld >。exe -安装

    d. Check the MySql in the windows service, And if it is not running, Start it by clicking on the service.

    d.检查windows服务中的MySql,如果它没有运行,请单击服务开始。

    e. If your using XAMMP . Start MySQL at the XAMMP control Panel.

    e.如果您使用XAMMP。在XAMMP控制面板上启动MySQL。


#5


3  

I had this error - stupid mistake was, I was using -p3307 to specify port, whereas I should have used -P3307, i.e. capital P. Small 'p' is for password arg :)

我犯了一个错误——愚蠢的错误是,我使用-p3307来指定端口,而我应该使用-p3307,即大写p . Small 'p'是密码arg:)

#6


2  

I have Windows 8.1 and I too had this problem. My teacher told me it was probably because my MySQL server had stopped running. She told me to go into the Computer Management utility (right click the lower-most left hand corner of the screen on Windows 8.1 to access Computer Management). Then under Services and Applications, open up the Services and find MySQL. You should be able to right-click on MySQL and restart it.

我有Windows 8.1,我也有这个问题。我的老师告诉我这可能是因为我的MySQL服务器停止运行。她让我进入计算机管理实用程序(右击Windows 8.1屏幕的最左下角以访问计算机管理)。然后在服务和应用程序下,打开服务并找到MySQL。您应该能够右键单击MySQL并重新启动它。

#7


2  

For the 5.7 version, I had the same problem and a simple fix did the trick. As Installed the workbench 5.7 there was another "software" of sorts called the "MySQL Installer Community". I ran this and ran the "Reconfigure" for the MySQL server. It took about a minute and the problem was no longer there.

对于5.7版本,我遇到了同样的问题,一个简单的修复就能解决问题。在安装workbench 5.7时,还有另一种“软件”,称为“MySQL安装程序社区”。我运行了这个程序,并为MySQL服务器运行了“重新配置”。只花了一分钟,问题就不存在了。

Hope it works!.(Keep in mind i was using the 5.7 version)

希望它工作!(请记住我使用的是5.7版本)

#8


1  

Solution 1:

解决方案1:

For 32bit: Run "mysql.exe" from: C:\Program Files\MySQL\MySQL Server 5.6\bin

对于32位:“mysql运行。exe”:C:\Program Files\MySQL\MySQL Server 5.6 \ bin

For 64bit: Run "MySQLInstanceConfig.exe" from: C:\Program Files\MySQL\MySQL Server 5.6\bin

对于64位:“MySQLInstanceConfig运行。exe”:C:\Program Files\MySQL\MySQL Server 5.6 \ bin

Solution 2:

解决方案2:

The error (2002) Can't connect to ... normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.

错误(2002)不能连接到……通常意味着系统上没有运行MySQL服务器,或者在尝试连接服务器时使用不正确的Unix套接字文件名或TCP/IP端口号。您还应该检查您正在使用的TCP/IP端口没有被防火墙或端口阻塞服务阻塞。

The error (2003) Can't connect to MySQL server on 'server' (10061) indicates that the network connection has been refused. You should check that there is a MySQL server running, that it has network connections enabled, and that the network port you specified is the one configured on the server.

错误(2003)无法连接到服务器上的MySQL服务器(10061),表明网络连接被拒绝。您应该检查是否有一个正在运行的MySQL服务器,是否启用了网络连接,是否指定的网络端口是服务器上配置的网络端口。

Source: http://dev.mysql.com/doc/refman/5.6/en/starting-server.html Visit it for more information.

来源:http://dev.mysql.com/doc/refman/5.6/en/starting-server.html

#9


1  

From what I've gathered this means the mysql service (mysqld) isn't running.

根据我的收集,这意味着mysql服务(mysqld)没有运行。

  • First make sure it is installed as a windows service : Run
  • 首先,确保它是作为windows服务安装的:运行

"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --install

“C:\程序文件\MySQL\服务器5.5\bin\mysqld”——安装

from the command line.

从命令行。

  • Next, start it up :
  • 接下来,启动它:

services.msc > MySQL > start

服务。启动msc > MySQL >

If it fails to restart, then you can follow these steps :

如果它不能重新启动,那么您可以遵循以下步骤:

  • open the command line as an administrator : cmd.exe > open as administrator
  • 以管理员的身份打开命令行:cmd。exe >以管理员身份打开
  • run "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld" --verbose
  • 运行“C:\程序文件\MySQL\服务器5.7\bin\mysqld”—verbose

it should fail and put the error log in a directory named data under C:\Program Files\MySQL\MysSQL Server 5.7\ . If it fails to create data for some reason, do it manually under that directory and try again. If you can figure out what's missing from what's in that log, then good, you're done.

它应该失败,把错误日志目录中命名C:\Program Files\MySQL\MysSQL Server 5.7 \下数据。如果由于某种原因无法创建数据,请在该目录下手动创建,并再次尝试。如果你能算出日志里少了什么,那么很好,就做完了。

If you've still got no luck, this is how I did it :

如果你仍然没有运气,我是这样做的:

  • goto C:\ProgramData\MySQL and copy the file named my.ini to C:\Windows\

    goto C:\编程数据MySQL,并复制名为my的文件。ini,C:\Windows\

  • try to start the service again from the command line : "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld" --verbose

    尝试从命令行重新启动服务:“C:\程序文件\MySQL\服务器5.7\bin\mysqld”—verbose

If it doesn't display any error, than the service startup was successfull. If it's still not working, than delete that my.ini you just copied from C:\Windows and start the service from the command line once again.

如果没有显示任何错误,则服务启动是成功的。如果它仍然不工作,就删除我的。ini你从C:\Windows抄袭,再次从命令行启动该服务。

it should work now

现在应该工作

#10


1  

if it is showing error 2003 (HY000): Can't connect to MySQL server on localhost (10061) than

如果显示的是error 2003 (HY000):无法连接到localhost(10061)上的MySQL服务器

  1. Search services.msc in run
  2. 搜索服务。msc在运行
  3. goto mysql properties
  4. 转到mysql属性
  5. copy the mysql service name
  6. 复制mysql服务名
  7. start cmd as administrator
  8. 开始cmd以管理员身份
  9. write: net start mysqlservicename .i.e mysql57 or etc it will show mysql is starting.
  10. 写入:net启动mysqlservicename。它将显示mysql启动。

#11


1  

In Windows 7 1)press Windows+R it opens Run 2)Enter services.msc 3)Find out mysql right click and start 4)if mysql was not found 1)Run cmd as administrator 2)goto C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin directory(to go back use cd..) and type "mysqld.exe --install" 5)follow step 3 That's all

在Windows 7 1)按下Windows+R,打开运行2)进入服务。msc 3)点击开始就发现mysql 4)如果mysql不是发现1)以管理员身份运行cmd 2)goto C:\Program Files (x86)\MySQL\MySQL Server 5.6 \ bin目录(回到使用cd . .)和“mysqld类型。5)按照步骤3进行安装

#12


1  

I solved this by adding the following arguments to the command line string:

我通过在命令行字符串中添加以下参数来解决这个问题:

mysql --user username --password password --host localhost --port 3306 databasename < "system path to .sql file"

mysql—用户名—密码—主机localhost—端口3306 databasename <“.sql文件的系统路径”

Without the --host & --port arguments, especially if you change the port to let's say 3307, which is a non default value, will cause this error.

如果没有-host & -port参数,特别是如果您将端口更改为比方说3307,这是一个非默认值,将导致这个错误。

#13


0  

I too had this problem, its easy to solve:

我也有这个问题,很容易解决:

Go to Control panel - System and maintenance - System - Advanced system settings - Environment variables - System variables - path - click edit - add

Go to Control panel - System and maintenance - System - Advanced System settings - Environment variables - System variables - path - click edit - add。

"c:\xampp\mysql\bin" - it should look like this :

“c:\xampp\mysql\bin”-应该是这样:

\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime Alternative\QTSystem;c:\xampp\mysql\bin

英特尔(Intel)\管理程序文件(x86)\管理程序文件(Intel)\管理程序文件(Intel)\管理程序文件(Intel)\管理程序文件(Intel)\管理程序文件(Intel)\管理程序文件(Intel)\管理程序文件\程序文件(x86)\ \OpenCL SDK\2.0\ \x86 \ \ \ \ \ \程序文件(x86)\程序文件(x86)\ OpenCL SDK\2.0\ 2.0\二进制\二进制\ \ \x64 \ C:\程序文件(x86 \Windows Live\共享

And don't forget to start MySQL from control panel of Xampp.

不要忘记从Xampp的控制面板启动MySQL。

#14


0  

Just turn off the firewall and remove the instance configuration. Add a new instance for the server.![Disable Firewall][1] Give he port number correctly as 3306 as default

只需关闭防火墙并删除实例配置。为服务器添加一个新实例。[禁用防火墙][1]提供正确的端口号为3306作为默认

#15


0  

For anyone who have the same problem of "Can't connect to MySQL server on 'localhost' (10061) " or "Can't connect to MySQL server on '127.0.0.1' (10061) ". You can install "MySQL Installer" and this is the link http://dev.mysql.com/downloads/windows/installer/5.6.html and this is a tutoriel for more help https://www.youtube.com/watch?v=AqQc3YqfelE

对于任何有“无法在'localhost'上连接到MySQL服务器”问题的人(10061)或“无法在'127.0.0.1'上连接到MySQL服务器”(10061)”。您可以安装“MySQL安装程序”,这是链接http://dev.mysql.com/downloads/windows/installer/5.6.html,这是一个tutoriel,用于更多的帮助https://www.youtube.com/watch?v=AqQc3YqfelE。

it works for me and i wish to work for you too.

它适合我,我也希望为你工作。

#16


0  

I had the same error. I resolved in this way

我犯了同样的错误。我这样决定

Go to start- MySQL Installer-community and run again the installer as a re-configuration(you will be asked so).

转到“启动- MySQL安装-社区”,再次运行安装程序作为重新配置(您将被要求这样做)。

Once asked if you want make MySQL instance to run as a Windows service, check the box.

一旦询问是否要让MySQL实例作为Windows服务运行,请选中“复选框”。

In case would do not work, try unistalling and installing again, and check the box to run MySQL as Windows service.

如果无法工作,请尝试再次进行统一和安装,并勾选将MySQL作为Windows服务运行的复选框。

#1


20  

this issue is very to solve by windows server users

这个问题很容易被windows服务器用户解决

  1. go to this path C:\Program Files\MySQL\MySQL Server 5.1\bin

    去这条路C:\Program Files\MySQL\MySQL Server 5.1 \ bin

  2. run this tool "MySQLInstanceConfig.exe"

    运行此工具“MySQLInstanceConfig.exe”

and config the instatnce again and problem solved

并重新配置状态,解决了问题

#2


13  

Please Try the following steps:

请尝试以下步骤:

  1. c:\mysql\bin>mysqld --install
  2. c:\ mysql \ bin > mysqld——安装
  3. c:\mysql\bin>mysqld --initialize
  4. c:\ mysql \ bin > mysqld——初始化

then press "Windows key + R" write "services.msc", run as admin

然后按“Windows key + R”write服务。msc”,作为管理员运行

start MySQL service.

启动MySQL服务。

#3


12  

The simple solution that worked for me is: change localhost to 127.0.0.1 in your database.yml or in your script if writing one.

对我来说,最简单的解决方案是:将数据库中的localhost更改为127.0.0.1。动笔或写在你的剧本里。

#4


8  

I also faced the same issue and resolved it by below setups:

我也遇到了同样的问题,通过下面的设置来解决:

  1. Check the MYSQL service in the windows service. If it is there and not running then start it. It will solve your problem.
  2. 检查windows服务中的MYSQL服务。如果它在那里而没有运行,那么就启动它。它会解决你的问题。

安装后无法在“localhost”(10061)上连接到MySQL服务器

  1. If MYSQL service is not present in windows service then follow below setups.

    如果在windows服务中没有MYSQL服务,请遵循以下设置。

    a. Open cmd as administrator.

    a.以管理员身份打开cmd。

    b. cd to C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin

    b . cd C:\Program Files (x86)\MySQL\MySQL Server 5.6 \ bin

    c. Run the command: C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>mysqld.exe --install

    c。运行该命令:C:\Program Files (x86)\MySQL\MySQL Server 5.6 \ bin mysqld >。exe -安装

    d. Check the MySql in the windows service, And if it is not running, Start it by clicking on the service.

    d.检查windows服务中的MySql,如果它没有运行,请单击服务开始。

    e. If your using XAMMP . Start MySQL at the XAMMP control Panel.

    e.如果您使用XAMMP。在XAMMP控制面板上启动MySQL。


#5


3  

I had this error - stupid mistake was, I was using -p3307 to specify port, whereas I should have used -P3307, i.e. capital P. Small 'p' is for password arg :)

我犯了一个错误——愚蠢的错误是,我使用-p3307来指定端口,而我应该使用-p3307,即大写p . Small 'p'是密码arg:)

#6


2  

I have Windows 8.1 and I too had this problem. My teacher told me it was probably because my MySQL server had stopped running. She told me to go into the Computer Management utility (right click the lower-most left hand corner of the screen on Windows 8.1 to access Computer Management). Then under Services and Applications, open up the Services and find MySQL. You should be able to right-click on MySQL and restart it.

我有Windows 8.1,我也有这个问题。我的老师告诉我这可能是因为我的MySQL服务器停止运行。她让我进入计算机管理实用程序(右击Windows 8.1屏幕的最左下角以访问计算机管理)。然后在服务和应用程序下,打开服务并找到MySQL。您应该能够右键单击MySQL并重新启动它。

#7


2  

For the 5.7 version, I had the same problem and a simple fix did the trick. As Installed the workbench 5.7 there was another "software" of sorts called the "MySQL Installer Community". I ran this and ran the "Reconfigure" for the MySQL server. It took about a minute and the problem was no longer there.

对于5.7版本,我遇到了同样的问题,一个简单的修复就能解决问题。在安装workbench 5.7时,还有另一种“软件”,称为“MySQL安装程序社区”。我运行了这个程序,并为MySQL服务器运行了“重新配置”。只花了一分钟,问题就不存在了。

Hope it works!.(Keep in mind i was using the 5.7 version)

希望它工作!(请记住我使用的是5.7版本)

#8


1  

Solution 1:

解决方案1:

For 32bit: Run "mysql.exe" from: C:\Program Files\MySQL\MySQL Server 5.6\bin

对于32位:“mysql运行。exe”:C:\Program Files\MySQL\MySQL Server 5.6 \ bin

For 64bit: Run "MySQLInstanceConfig.exe" from: C:\Program Files\MySQL\MySQL Server 5.6\bin

对于64位:“MySQLInstanceConfig运行。exe”:C:\Program Files\MySQL\MySQL Server 5.6 \ bin

Solution 2:

解决方案2:

The error (2002) Can't connect to ... normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.

错误(2002)不能连接到……通常意味着系统上没有运行MySQL服务器,或者在尝试连接服务器时使用不正确的Unix套接字文件名或TCP/IP端口号。您还应该检查您正在使用的TCP/IP端口没有被防火墙或端口阻塞服务阻塞。

The error (2003) Can't connect to MySQL server on 'server' (10061) indicates that the network connection has been refused. You should check that there is a MySQL server running, that it has network connections enabled, and that the network port you specified is the one configured on the server.

错误(2003)无法连接到服务器上的MySQL服务器(10061),表明网络连接被拒绝。您应该检查是否有一个正在运行的MySQL服务器,是否启用了网络连接,是否指定的网络端口是服务器上配置的网络端口。

Source: http://dev.mysql.com/doc/refman/5.6/en/starting-server.html Visit it for more information.

来源:http://dev.mysql.com/doc/refman/5.6/en/starting-server.html

#9


1  

From what I've gathered this means the mysql service (mysqld) isn't running.

根据我的收集,这意味着mysql服务(mysqld)没有运行。

  • First make sure it is installed as a windows service : Run
  • 首先,确保它是作为windows服务安装的:运行

"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --install

“C:\程序文件\MySQL\服务器5.5\bin\mysqld”——安装

from the command line.

从命令行。

  • Next, start it up :
  • 接下来,启动它:

services.msc > MySQL > start

服务。启动msc > MySQL >

If it fails to restart, then you can follow these steps :

如果它不能重新启动,那么您可以遵循以下步骤:

  • open the command line as an administrator : cmd.exe > open as administrator
  • 以管理员的身份打开命令行:cmd。exe >以管理员身份打开
  • run "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld" --verbose
  • 运行“C:\程序文件\MySQL\服务器5.7\bin\mysqld”—verbose

it should fail and put the error log in a directory named data under C:\Program Files\MySQL\MysSQL Server 5.7\ . If it fails to create data for some reason, do it manually under that directory and try again. If you can figure out what's missing from what's in that log, then good, you're done.

它应该失败,把错误日志目录中命名C:\Program Files\MySQL\MysSQL Server 5.7 \下数据。如果由于某种原因无法创建数据,请在该目录下手动创建,并再次尝试。如果你能算出日志里少了什么,那么很好,就做完了。

If you've still got no luck, this is how I did it :

如果你仍然没有运气,我是这样做的:

  • goto C:\ProgramData\MySQL and copy the file named my.ini to C:\Windows\

    goto C:\编程数据MySQL,并复制名为my的文件。ini,C:\Windows\

  • try to start the service again from the command line : "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld" --verbose

    尝试从命令行重新启动服务:“C:\程序文件\MySQL\服务器5.7\bin\mysqld”—verbose

If it doesn't display any error, than the service startup was successfull. If it's still not working, than delete that my.ini you just copied from C:\Windows and start the service from the command line once again.

如果没有显示任何错误,则服务启动是成功的。如果它仍然不工作,就删除我的。ini你从C:\Windows抄袭,再次从命令行启动该服务。

it should work now

现在应该工作

#10


1  

if it is showing error 2003 (HY000): Can't connect to MySQL server on localhost (10061) than

如果显示的是error 2003 (HY000):无法连接到localhost(10061)上的MySQL服务器

  1. Search services.msc in run
  2. 搜索服务。msc在运行
  3. goto mysql properties
  4. 转到mysql属性
  5. copy the mysql service name
  6. 复制mysql服务名
  7. start cmd as administrator
  8. 开始cmd以管理员身份
  9. write: net start mysqlservicename .i.e mysql57 or etc it will show mysql is starting.
  10. 写入:net启动mysqlservicename。它将显示mysql启动。

#11


1  

In Windows 7 1)press Windows+R it opens Run 2)Enter services.msc 3)Find out mysql right click and start 4)if mysql was not found 1)Run cmd as administrator 2)goto C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin directory(to go back use cd..) and type "mysqld.exe --install" 5)follow step 3 That's all

在Windows 7 1)按下Windows+R,打开运行2)进入服务。msc 3)点击开始就发现mysql 4)如果mysql不是发现1)以管理员身份运行cmd 2)goto C:\Program Files (x86)\MySQL\MySQL Server 5.6 \ bin目录(回到使用cd . .)和“mysqld类型。5)按照步骤3进行安装

#12


1  

I solved this by adding the following arguments to the command line string:

我通过在命令行字符串中添加以下参数来解决这个问题:

mysql --user username --password password --host localhost --port 3306 databasename < "system path to .sql file"

mysql—用户名—密码—主机localhost—端口3306 databasename <“.sql文件的系统路径”

Without the --host & --port arguments, especially if you change the port to let's say 3307, which is a non default value, will cause this error.

如果没有-host & -port参数,特别是如果您将端口更改为比方说3307,这是一个非默认值,将导致这个错误。

#13


0  

I too had this problem, its easy to solve:

我也有这个问题,很容易解决:

Go to Control panel - System and maintenance - System - Advanced system settings - Environment variables - System variables - path - click edit - add

Go to Control panel - System and maintenance - System - Advanced System settings - Environment variables - System variables - path - click edit - add。

"c:\xampp\mysql\bin" - it should look like this :

“c:\xampp\mysql\bin”-应该是这样:

\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime Alternative\QTSystem;c:\xampp\mysql\bin

英特尔(Intel)\管理程序文件(x86)\管理程序文件(Intel)\管理程序文件(Intel)\管理程序文件(Intel)\管理程序文件(Intel)\管理程序文件(Intel)\管理程序文件(Intel)\管理程序文件\程序文件(x86)\ \OpenCL SDK\2.0\ \x86 \ \ \ \ \ \程序文件(x86)\程序文件(x86)\ OpenCL SDK\2.0\ 2.0\二进制\二进制\ \ \x64 \ C:\程序文件(x86 \Windows Live\共享

And don't forget to start MySQL from control panel of Xampp.

不要忘记从Xampp的控制面板启动MySQL。

#14


0  

Just turn off the firewall and remove the instance configuration. Add a new instance for the server.![Disable Firewall][1] Give he port number correctly as 3306 as default

只需关闭防火墙并删除实例配置。为服务器添加一个新实例。[禁用防火墙][1]提供正确的端口号为3306作为默认

#15


0  

For anyone who have the same problem of "Can't connect to MySQL server on 'localhost' (10061) " or "Can't connect to MySQL server on '127.0.0.1' (10061) ". You can install "MySQL Installer" and this is the link http://dev.mysql.com/downloads/windows/installer/5.6.html and this is a tutoriel for more help https://www.youtube.com/watch?v=AqQc3YqfelE

对于任何有“无法在'localhost'上连接到MySQL服务器”问题的人(10061)或“无法在'127.0.0.1'上连接到MySQL服务器”(10061)”。您可以安装“MySQL安装程序”,这是链接http://dev.mysql.com/downloads/windows/installer/5.6.html,这是一个tutoriel,用于更多的帮助https://www.youtube.com/watch?v=AqQc3YqfelE。

it works for me and i wish to work for you too.

它适合我,我也希望为你工作。

#16


0  

I had the same error. I resolved in this way

我犯了同样的错误。我这样决定

Go to start- MySQL Installer-community and run again the installer as a re-configuration(you will be asked so).

转到“启动- MySQL安装-社区”,再次运行安装程序作为重新配置(您将被要求这样做)。

Once asked if you want make MySQL instance to run as a Windows service, check the box.

一旦询问是否要让MySQL实例作为Windows服务运行,请选中“复选框”。

In case would do not work, try unistalling and installing again, and check the box to run MySQL as Windows service.

如果无法工作,请尝试再次进行统一和安装,并勾选将MySQL作为Windows服务运行的复选框。