#2002 - Connection refused — The server is not responding (or the local server's socket is not correctly configured) - xampp

My phpmyadmin showing this error, I am working on Ubuntu OS:
2002 - Connection refused — The server is not responding (or the local server's socket is not correctly configured)
mysqli_real_connect(): (HY000/2002): Connection refused
Connection for controluser as defined in your configuration failed
mysqli_real_connect(): (HY000/2002): Connection refused
This problem is occurred on Ubuntu, I tried all previous stack overflow answers, but it doesn't work for me.

I faced that similar problem using lamp , check if you may have more than two mysql path like in
Find all the other mysql installed in your system
`whereis mysql`
`mysql: /opt/lampp/bin/mysql /opt/lampp/bin/mysql.server /usr/share/man/man1/mysql.1.gz`
Now if in you're system two mysql if overlapping then remove others and keep only one mysql installed by lamp
sudo rm -rf /etc/mysql
Here is the link i found for apache2 i did the same with mysql and it's working
http://xmodulo.com/how-to-uninstall-and-remove-apache2-on-ubuntu-debian.html
Finally stop all the mysql existing service running
sudo service mysql stop
sudo /etc/init.d/apache2 stop
sudo /opt/lampp/lampp start

Related

Getting Error running psql Command for PostgreSQL

I have installed the Postgres on my windows 10 PC and I set the environment variable also after when I run psql command it shows following error:
could not connect to server:
Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5433?
I have checked the port no service is running on 5433 and also tried changing it but getting the same error.I also tried installing Postgres outside Program File (thought maybe it's permission related issue) but still problem persist.I installed Postgres 13

Postgresql refusing connection to server

I have been trying to connect to my postgresql 9.3 server but I keep getting this error.
Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting TCP/IP
connections on port 5433? could not connect to server: Connection
refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1)
and accepting TCP/IP connections on port 5432?
I have tried connecting through pgadmin3 and the command line.
psql.exe -h localhost -U postgres
This command also gives the same error.
I am on a windows machine. I have tried creating a separate server also with the same result.
I have no idea whats happening. Please help.
Thanks
As the error clearly tells or asks actually, Is the server running on host "localhost"?
So the chances are, the Postgres server is not running on your machine.
You can start the service(the layman way) by going to services and starting the service.
Here is how you do it:
Open Run Window by Winkey + R
Type services.msc
Search Postgres service based on the version installed.
Click stop, start or restart the service option.
Start the server with postgres -D ['data folder']
As in docs:
http://www.postgresql.org/docs/9.1/static/server-start.html
So in my Windows postgres installation from the bin folder:
postgres.exe -D ..\data
where data is in the postgresql installation folder
I had the same issue like Venkatesh had. But in my case I had installed pgadmin in version 9. But also installed version 12 at the same time.
When I now uninstalled version 9, the port was already set in the config of version 12 and not given free.
So my solution was to change the port of version 12 in the postgresql.conf file. Or even simplier, change the port in the server creation from 5432 to 5433. Now you are able to create a server again.
I got this same error. This happened when I uninstall and re-install postgress, for some reason after second-time installation, pgadmin tries to connect to the server on port 5433 whereas the server is running on 5432.
Rightclick server properties and change the port to 5432 and try to connect again. It should work now.
Your server running on port 5432 but in the properties, the port is set to 5433.
You must go to pgAdmin, click on database version, ex: PostgresSQL 10 and edit properties.
A new window appears and you need to change the port to 5432 [this is default port].
Hope this helps.

Postgres: Unable to connect to domain socket

Running psql gets me this:
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
I installed Postgres 9.3.3 using Homebrew.
which psql gives /usr/local/bin/psql
This seems to be a common issue. I'm terribly sorry to ask again, but I've gone through at least a dozen Q&As here and can't resolve the issue. A few posts I've gone through include:
Why am I getting a could not connect to server error for postgres in Mac OS Lion?
Postgres cannot connect to server on Unix domain socket 5432
Can not connect to local PostgreSQL
Many thanks,
Justin
Have you modified postgresql.conf to accept incoming TCP/IP connections? You should uncomment the listen_addresses parameter and set it to an appropriate subnet mask. Then in pg_hba.conf you have to add a line to enable connections to databases over TCP/IP. Both configuration files are in your data directory (don't know where that is on OSX).

"network error: connection refused", putty error

I am trying to run putty on Windows 7.
I need to run some SSH commands to upgrade Magento. Every time putty gives me this fatal error:
network error: connection refused
I have even tried to use it through winSCP. Note that putty is running fine on my client's side, but for me it's giving me that error every time.
I tried using port 22, 23 and a few others without success. I have also tried with Windows Firewall both enabled and disabled.
Thank you.
Install open-ssh or ssh in target Linux machine solved my problem .
Use below commands:
sudo apt install ssh
sudo systemctl status ssh
sudo systemctl enable ssh
The following are the list of possibilities of this error:
1) Common cause is - Your IP is blocked or not whitelisted in the server which can be done by editing the file at /etc/csf/csf.conf
2) Disable the windows firewall settings and check..
The above two things should work in most of the cases
3) This is very unusual and when the above two options fails it is very difficult to find the solution
In this case the traceroute to the server host or IP works usually but putty fails
port 22 looks normal and working but connection fails and restarting SSH (service ssh restart) also does not work
reboot or restart the server but still fails
Adding IP in firewalls or whitelisting the local IP may not workout
This case generally happens when the server is migrated or new server. IP of the old server might be whitelisted locally, but don't have port 22 open, or some other local filtering is occurring for this new IP but not the old server IP..
In this case you need to change the port to some 522 or 530 some unusual port will help in sorting it out.. The same port you have to use for the SFTP connection also .. where as FTP connections works normally..
or you have to whitelist the IP locally or open the TCP in and out to port 22 if you want to use the port 22..

What would cause intermittent EC2 > RDS host resolution issues?

The issue is an inability to resolve the DB host but it's not persistent.
Environment:
AWS EC2 Ubuntu 16.04
connecting to:
MYSQL 5.7 RDS
This started just after an upgrade from Ubuntu 14.04 to 16.04.
It works probably 99/100 tries, but then fails and throws this exception: An exception occurred in driver: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known.
It appears amazon supplies a local DNS server for your EC2 instance. I believe it has a request limit which causes failure if you go over it. My fix was to add this file: "/etc/resolvconf/resolv.conf.d/tail;" with the contents "nameserver 1.1.1.1" basically setting 1.1.1.1 as my fallback DNS server. It's a bit slower since it's outside the network, but it's better than a complete failure.
Source: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-limits

Resources