No connection could be made because the target machine actively refused it

自古美人都是妖i 提交于 2019-12-17 07:49:09

问题


When I was trying to connect my phpmyadmin on my XAMPP, it gave an error:

#2002 - No connection could be made because the target machine actively refused it. 

Can any help me to resolve it?


回答1:


If your operating system is Windows 7:

  • go to control panel -> Administrative Tools -> Services
  • find mysql then right-click, click start

If your operating system is Linux (Ubuntu):

  • in terminal type this command: sudo /etc/init.d/mysql start

Good Luck




回答2:


Go to :

xampp/phpmyadmin/config.inc.php

open the file config.inc.php Go to line no:31

$cfg['Servers'][$i]['controluser'] = 'pma';

Change the line to :

$cfg['Servers'][$i]['controluser'] = 'root';

Restart your system.

Reference




回答3:


Please go to c:\xampp\tmp folder and delete all the files. It works for me may help you.




回答4:


Go to

C:\Users\YourUser\AppData\Local\Temp

Delete all the files.It will work.




回答5:


Please try changing connect_type in your config.inc.php from 'tcp' to 'http'. This file exists in the phpMyAdmin top level directory.

Existing line looks like this:

$cfg['Servers'][$i]['connect_type'] = 'tcp';

New line should be looking like this:

$cfg['Servers'][$i]['connect_type'] = 'http';



回答6:


Assuming you're trying to connect to http://localhost/phpmyadmin.

From XAMPP control panel start both the Apache module and the MySQL module.




回答7:


Sometimes if you delete your temporary files in windows in

C:\Windows\Temp

and

C:\Users\YourUser\AppData\Local\Temp

it works.




回答8:


Okay, so i tried all of the answers and none of them worked. If you are using different port than 3306 for MySQL you need to specify it in config.inc.php.

So since i was using port 3308, my solution was adding the following line in config.inc.php:

$cfg['Servers'][$i]['port'] = 3308;

add it right bellow the user, password or extension lines.




回答9:


Instead of localhost, type this in your address bar localhost:<PORT> (e.g. localhost:88)



来源:https://stackoverflow.com/questions/16712581/no-connection-could-be-made-because-the-target-machine-actively-refused-it

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!