#2002 - 无法建立连接,因为目标计算机主动拒绝它

问题描述 投票:16回答:9

我意识到这可能被视为重复,但我已经查看了其他响应,他们没有为我解决问题。

我最近在Windows 7上安装了Zend Studio和Zend Server以及mysql插件。

我不是一个合格的服务器管理员,但我也不是完全无能;我一直在努力让本地开发'服务器'减少上传/下载时间。

当我说服务器/机器我的意思是我的家用电脑

我试图让mysql与Zend Server一起工作。

我一直收到的错误是(或详细):

#2002 Cannot log in to the MySQL server
or (if i change to 'config' authentication type)
#2002 - No connection could be made because the target machine actively refused it.

The server is not responding (or the local server's socket is not correctly configured).

我试过了:

  • 将$ cfg ['Servers'] [$ i] ['host']从'localhost'更改为'127.0.0.1'
  • 添加/删除$ cfg ['Servers'] [$ i] ['socket'] ='';
  • 从cookie更改为config auth类型
  • 重新安装服务器和mysql
  • 禁用防火墙
  • 重启机器

Zend的方法是'配置phpmyadmin设置屏幕'...完成,我不知道多少次。

这里的任何人都能伸出援助之手,还是指向我尚未尝试过的方向?

mysql zend-server
9个回答
38
投票
  1. 转到C:\ wamp \ bin \ mysql \ mysql [your-version] \ data
  2. 在其他任何地方复制并保存“ib_logfile0”和“ib_logfile1”。
  3. 删除“ib_logfile0”和ib_logfile1

为我做了诀窍。希望它也适合你。

它的工作正常。但是我们必须停止apache和mysql,我们需要退出xampp然后删除文件。删除成功后。现在开始xampp它将正常工作..


-1
投票

以下步骤对我有用。

  1. 转到wamp \ apps \ phpmyadmin
  2. 搜索config.inc.php
  3. 搜索127.0.0.1并替换为“localhost”。

9
投票

只需转到“控制”面板,即可启动Apache和MySQL服务。


3
投票

直到昨天我才能连接到phpMyAdmin,但今天我开始收到此错误:

2002-no-connection-could-be-made-because-the-target-machine-actively-refused

这里的答案都没有真正帮助我解决问题,有什么帮助我分享如下:

我查看了mysql日志。[C:\ wamp \ logs \ mysql.log]

它说

2015-09-18 01:16:30 5920 [Note] Plugin 'FEDERATED' is disabled.
2015-09-18 01:16:30 5920 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-09-18 01:16:30 5920 [Note] InnoDB: The InnoDB memory heap is disabled
2015-09-18 01:16:30 5920 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-09-18 01:16:30 5920 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-09-18 01:16:30 5920 [Note] InnoDB: Not using CPU crc32 instructions
2015-09-18 01:16:30 5920 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-09-18 01:16:30 5920 [Note] InnoDB: Completed initialization of buffer pool
2015-09-18 01:16:30 5920 [Note] InnoDB: Highest supported file format is Barracuda.
2015-09-18 01:16:30 5920 [Note] InnoDB: The log sequence numbers 1765410 and 1765410 in ibdata files do not match the log sequence number 2058233 in the ib_logfiles!
2015-09-18 01:16:30 5920 [Note] InnoDB: Database was not shutdown normally!
2015-09-18 01:16:30 5920 [Note] InnoDB: Starting crash recovery.
2015-09-18 01:16:30 5920 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-09-18 01:16:30 5920 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace harley/login_confirm uses space ID: 6 at filepath: .\harley\login_confirm.ibd. Cannot open tablespace testdb/testtable which uses space ID: 6 at filepath: .\testdb\testtable.ibd
InnoDB: Error: could not open single-table tablespace file .\testdb\testtable.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.

我得到了这个家伙正在创造一个问题的线索 - InnoDB: Error: could not open single-table tablespace file .\testdb\testtable.ibd

这条线2015-09-18 01:16:30 5920 [Note] InnoDB: Database was not shutdown normally!

嗯,对我来说testdb只是一个测试db!因此我决定在C:\ wamp \ bin \ mysql \ mysql5.6.17 \ data \ testdb中删除此文件

并重新启动所有服务,并转到phpMyAdmin,这次没有问题,phpMyAdmin打开:)


2
投票

我和Wampserver有同样的问题。它对我有用:

您必须更改此文件:“C:\ wamp \ bin \ mysql [mysql_version] \ my.ini”例如:“C:\ wamp \ bin \ mysql [mysql5.6.12] \ my.ini”

并将默认端口3306更改为80.(第20和第27行,两者都有)

port = 3306 to port = 80

我希望这是有帮助的。


2
投票

为了摆脱那个错误,我所要做的就是重启我的wamp服务器。


2
投票

在我的情况下,我做了以下,并为我工作

  1. 我点击了wamp图标。
  2. 我去了MySQL>服务管理'wampmysqld64'>安装服务
  3. 然后单击wamp图标>重新启动所有服务。

1
投票

请检查etc文件夹中的hosts文件并添加以下注释然后运行wamp server。

127.0.0.1 localhost

路径:C:\ Windows \ System32 \ drivers \ etc


1
投票

我刚刚删除了mysql服务并再次安装它。这个对我有用


0
投票

请检查您的mysql服务是否正在运行。

对于windows用户:检查服务 - mysql服务

对于Linux用户:检查mysql服务/恶魔正在运行(服务mysql状态)

感谢和问候Jaswar Vipin Kumar

© www.soinside.com 2019 - 2024. All rights reserved.