Magento error - "Can't connect to MySQL server" - php

In Magento, when I click System->Magento Connent->Magento Connect Manager it shows the following error:
SQLSTATE[HY000] [2003] Can't connect to MySQL server on '192.168.1.122' (111)
How can I fix this issue?

Try to flush cache from backend or delete /var/cache/*

Related

php artisan make controller command try connecting to mysql and throwing connection error

when i run any php artisan commands make,key its throwing an error saying
In Connection.php line 664:
SQLSTATE[HY000] [2002] No connection could be made because the
target machine actively refused it. (SQL: select * from system
where key = woocommerce_version limit 1)
In Connector.php line 70:
SQLSTATE[HY000] [2002] No connection could be made because the
target machine actively refused it.
why it tries to connect to mysql database it has nothing to do with it
my server is iis i don't know if its mis-configured, but the same laravel application in localhost shows no error

Mysql Remote Connection Failed

Im trying with php to connect my remote server's mysql im getting this error:
"Database Connection Error: SQLSTATE[HY000] [2002] connection refused"
I made what said in that page : https://www.configserverfirewall.com/ubuntu-linux/enable-mysql-remote-access-ubuntu/
this is my setting now:
and ofcourse restarted mysql.
ANd its still saying same error "Database Connection Error: SQLSTATE[HY000] [2002] connection refused"
What can i do else?
this is my connection setting:
When i try port 3306 same error. What can cause that?
ps: also this is a remote connection from a hosting shared to my dedicated server
it was about cloudflare or other proxies. Fixed.

when I start apache MySQL server, I get error " (HY000/2002): No connection could be made because the target machine actively refused it."

after the start apache server, i could not access PHPMyAdmin. when i try to access i get an error and auto-stop MySQL server.
- mysqli_real_connect(): (HY000/2002): No connection could be made
because the target machine actively refused it.
- Connection for controluser as defined in your configuration failed.
mysqli_real_connect(): (HY000/2002): No connection could be made
because the target machine actively refused it.
- phpMyAdmin tried to connect to the MySQL server, and the server
rejected the connection..
how can i solve this error
Add below line under config.inc.php
$cfg['Servers'][$i]['port'] = 8111;
If you are on Windows os and the above solution does not work, just check if your mysql is running with "netstat -ano" command, if the services are not running just try starting the mysql service.

MySQL randomly says SQLSTATE[HY000] [2002] Connection Refused

Using PHP, Symfony Framework, MySQL.
Switched to new server.
System randomly triggers SQLSTATE[HY000] [2002] Connection refused. Does this related to server/database setting?
Database setting adjusted:
max_allowed_packet: 268435456

Mongodb:Failed to connect

I am new to MongoDB.I installed mongodb and used with Laravel framework.Its had been worked for a long time without any issues.But currently while i try to acess my website it shows:
Failed to connect to: localhost:27017: Connection refused
when i try to acces mongodb via command line,it shows:
warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146 exception: connect failed
when i try to access it via rock tool,it shows:
Unable to connect MongoDB, please check your configurations. MongoDB said:Failed to connect to: 127.0.0.1:27017: Connection refused.
what i will do? I can't figure what's wrong from my part since its working after the past months.I do nothing since the last days.Thanks in advance..
After a short break, I can find out the solution.
The origin of that issue is the unexpected shutdown of the system.So i run the below code in command prompt:
sudo rm /var/lib/mongodb/mongod.lock
mongod --repair
sudo service mongodb start
then after the above code run, its working fine :)

Categories