Srikanth Kolli
Srikanth Kolli

Reputation: 912

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

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?

Upvotes: 20

Views: 123288

Answers (11)

Atmaram
Atmaram

Reputation: 9

Just insures that the port no. in file - phpmyadmin (config.inc.php) and my.ini are same (mostly 3306) and not use by any other processenter image description hereenter image description here

Upvotes: 0

Jake Peralta
Jake Peralta

Reputation: 547

Check if your MySql service is running or not.

You can check it by searching Services in Start and then check the status of mysql80 service. If your service is not running then start service by right clicking on it and then Start.

Or you can use CMD.

Open Command Prompt as administrator and then run net start mysql80.

Upvotes: 0

Celestial
Celestial

Reputation: 933

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.

Upvotes: 23

Mohammed Tahair Pasha
Mohammed Tahair Pasha

Reputation: 135

Go to

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

Delete all the files.It will work.

Upvotes: 11

hamidreza samsami
hamidreza samsami

Reputation: 419

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

Upvotes: 5

akshay ahir
akshay ahir

Reputation: 61

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

Upvotes: 2

Natalie
Natalie

Reputation: 196

Sometimes if you delete your temporary files in windows in

C:\Windows\Temp

and

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

it works.

Upvotes: 1

andreas nilsson
andreas nilsson

Reputation: 21

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

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

Upvotes: 2

Gumption Technologies
Gumption Technologies

Reputation: 49

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';

Upvotes: 3

Pradip Kharbuja
Pradip Kharbuja

Reputation: 3532

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

Upvotes: 8

Abdallah
Abdallah

Reputation: 644

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

Upvotes: 7

Related Questions