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

11

20

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?

Enhance answered 23/5, 2013 at 11:20 Comment(1)
You can open your xampp with administrative right means Run as administrator and then start Apache after that run MySQL it works if you haven't any other issue..Supernumerary
P
23

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.

Picket answered 17/4, 2019 at 18:19 Comment(2)
Thanks alot man. You literally saved my time after wasting so much time.Ref
Yes this is the answer . I ve been trying for days. Thanks mate! I really appreciate it.Guffey
T
11

Go to

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

Delete all the files.It will work.

Teletypewriter answered 18/8, 2018 at 13:0 Comment(1)
Worked for me. Have multiple installations of mysql, which must have caused the issue.Gwalior
C
8

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

Caundra answered 18/3, 2014 at 7:5 Comment(1)
Thanks pradip which u have posted u r answer very helped me.Dimetric
S
7

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

Steamtight answered 19/7, 2013 at 11:40 Comment(1)
I get this error when I start mysql from services app. Windows could not start the mysql service on Local Computer. Error 1067: The process terminated unexpectedly.Paprika
H
5

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

Hinckley answered 1/7, 2018 at 5:23 Comment(0)
C
3

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';
Climb answered 28/4, 2014 at 6:34 Comment(1)
Thanks u r answer has been used for me.Dimetric
R
2

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

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

Retrogressive answered 12/5, 2015 at 8:11 Comment(1)
This worked for me, must be another issue for the OPBissau
L
2

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

Leatherjacket answered 24/10, 2016 at 9:10 Comment(0)
E
1

Sometimes if you delete your temporary files in windows in

C:\Windows\Temp

and

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

it works.

Expanded answered 10/6, 2015 at 15:39 Comment(1)
Thanks. This worked for me. I have two installs of xampp (one with php 5.6 and the other 7.1) and the error was shown to me after changing from one phpmyadmin (xampp php 7.1) to the other (xampp php5). After clearing the %SystemRoot%\Temp folder, all were good again.Tangram
C
0

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.

Counterproductive answered 14/12, 2020 at 14:29 Comment(0)
B
0

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

Brodie answered 29/12, 2023 at 20:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.