phpMyAdmin unable to connect with mysql - php

I had installed MAMP on my windows 10 machine. I had then configured the MySQL thru the phpMyAdmin and had installed the WordPress. Later due to certain issues, I had to un-install and re-install the MAMP again. This time Apache started running and I could reach localhost/MAMP/, but when I click on phpMyAdmin, I get the message:
"mysqli_real_connect(): (HY000/2002) No connection could be made
because the target machine actively refused it
.....You should check the host, user name and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server". I ran the command> MySQL -u root -p status. It asked for a password. On giving the password, I got the following: Error 2003 (HY000) Can't connect to MySQL server on localhost (10061).
Please help with a workaround.

The error was resolved thru re-installation and taking care to disable the installation of MAMP Pro which happens by default.

I usually see the "actively refused" error when I try to connect to a port that the MySQL server is not actually running on. That said, I don't know why this would happen out of the blue. Maybe you should be using WAMP instead of MAMP?
You could probably troubleshoot this issue remotely with third party tools that have debug logging (MySQLShell through its Application Log)

Check all your Microsoft Redistribute Packages are installed correctly. If the problem exist then use the XAMPP or WAMP for the Windows because MAMP is generally used for the MAC OS.

Related

Unable to access MySql db

I have been working on php for some time. I have cloned a git repo yesterday. Just after that i am able to connect to MySQL server, access MySQL db and phpmyadmin properly. Today, I started the server and tried to access phpmyadmin from xampp control panel, as soon as I try to open it, apache port is changing automatically to 49868 and mysql connection terminates.Then, again apache changes its ports to previous states.
Any help is appreciated. Thanks in advance.
EDIT : I reinstalled everything and it worked.
Check if another application is using port 80.
In command prompt use:
netstat -aon | findstr :80
enter image description here
If windows verify if in task manager is already running XAMPP.

How to fix "#2003 - Can't connect to MySQL server on '127.0.0.1' (61) the server is not responding."

I am having issues connecting to MySQL server. I go to localhost:8888/phpMyAdmin/?lang=en and get the error:
"#2003 - Can't connect to MySQL server on '127.0.0.1' (61) the server
is not responding."
I've tried many different solutions however, none have worked. If anyone has any advice or ways to fix this, it would be a great help.
Ensure that MySQL is enabled in MAMP, and that you have also enabled "Allow network access to MySQL" in MAMP's MySQL settings page.
I'd recommend restarting your system, and confirming that mysql daemon start with your mamp server properly. You may also try logging into the command line mysql, and observe the configuration. You seem to suggest that you have tried many things, and I assume that you tried restarting. I know it seems ridiculous to ask you to repeat this... but, you want a clean entry point to observe the issue. There may be another mysql server running as well, or it may not be serving where you think it is. By logging into MySql as root, you should be able to determine some of the mis-configuration issues.
I went to /Applications/MAMP/bin/phpMyAdmin/config.inc.php and updated the line $cfg['Servers'][$i]['host'] = '127.0.0.1';
from 127.0.0.1 to localhost.

MySQL Workbench 5.6 crashes on connection to localhost

I'm running Apache 2.2 and MySQL Workbench, and using PHP to access the database.
The problem is, when I try to open the database I've made, MySQL Workbench can't seem to connect to the localhost at port 80, and the program stops responding.
How can I fix this?
Update: After some time of the program simply not responding, it gave me this error message:
"Unhandled exception: Lost connection to MySQL server at 'waiting for initial communication packet', system error 10060 (code 2013)"
A wamp installation has a lot of issues. Instead, you can run a Virtual Machine with ubuntu and run there LAMP. it is way more reliable than running wamp that is not supposed to be "equal" in terms of your production environment - that for sure is linux based OS. Also, keep in mind that programs such skype blocks the port 80 and 443. Search what programs are using the port for mysql... that's why I don't develop AMP apps under windows, but under linux.

MySQL randomly dies

I have an issue with a mysql database that randomly just go and die obviously. When this occurs and I try to use mysql in the terminal this occurs:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
What causes this? If I restart the service it works splendid until the next random occurance when it stops working again. Am all open for ideas.
You are not mentioned your OS, mysql version, XAMPP/WAMPP here. There are some reason for this error.
If OS is windows.
If you have installed XAMPP more than one in various driver of your system, this error may happen
If you installed skype, It may be using mysql default port 3306.
Clear your browser cache and try it.
Issue was memory related. The system killed processes for more essential parts.

How to activate the mysql database in xampp on windows platform?

I've installed XAMPP on my Windows XP. I started the XAMPP control panel and it shows apache and mysql are running.
When I check the status by going to localhost/xampp it shows:
mysql : deactivated
When I run php files that access the mysql database, it shows the following errors:
Warning: mysql_connect() [function.mysql-connect]: [2002] No connection could
be made because the target machine actively refused it. (trying to connect
via tcp://localhost:3306) in C:\xampp\htdocs\Elo_algorithm.php on
line 18
I've been through the XAMPP troubleshooting page and FAQ but I don't understand what to do. The XAMPP control panel shows mysql is running, but xampp status shows: deactivated.
What is going on here?
OK I got this issue resolved in my case, hopefully will help you too. Problem was system itself. If you run Vista, Win7, win8 you probably have permission issue. Simple go to XAMPP root and find mysql_start.bat and run it. Immediately after clicking your firewall will appear with message asking for permission. All you have to do is to allow permission (for private networks such a home or work network).
MySQL database ACTIVATED - and that's what matters ;)
I hope that helps to all of you who did not get an answer so far.
Cheers!
You should view in the xampp installation the file "\xampp\mysql\data\mysql_error.log".
This file contais the error log of MySQL and in it you can detect any problem like por in use.
For example, this lines of log show that the port 3306 (the mysql default) is used by another application and can't be accessed.
111130 8:39:56 [ERROR] Can't start server: Bind on TCP/IP port: No such file or directory
111130 8:39:56 [ERROR] Do you already have another mysqld server running on port: 3306 ?
111130 8:39:56 [ERROR] Aborting
If all in the MySQL is correct probably the problem is related to the driver in the php application. Currently PHP has two MySQL connector types, the "mysql" and the "mysqli", MySQL "mysql" connector, that use "mysql_" (the method that you are using to connect is mysql_connect) prefixed functions, is used for old MySQL 4 applications and when the MySQL 5.x if is in configured with the "old password" parameter. The "mysqli" is used for the new mysql 5.x versions and in php you must use "mysqli_" prefixed functions like "mysqli_connect.
The version used by the lastest versions of xampp is MySQL 5.5 and you require to used the mysqli connector.
Check whether the value of port variable in the "my.ini" file in your xampp mysql folder is 3306 or 8888
i was facing the same problem. I had to run setup-xampp.bat to make it working.
By the way I came across a new WAMP stack called AMPPS. It looks quite easier than XAMP. You should try. http://www.ampps.com
I could not get XAMPP for Windows (1.7.4 Beta2--I know; ancient) to work on Windows 7 (32 bit) as the MySql would not "activate" or connect to Apache. Just by dumb luck I installed .NET Framework 4.6 for another application and suddenly--Whoopee! It started working!

Categories