Error: Can't connect to MySQL Server (110) - mysql

I have a home-hosted MySQL Server which for some reason is giving me this:
Connection failed: Can't connect to MySQL server on '9x.x.xxx.xx4' (111)
I've portforwarded 3306, and when looking for solutions, for example, putting a hashtag before "bind-address", it would not connect me at all. Another example is changing the "bind-address" value to my public IP, but that gave me the same error. I can connect on phpMyAdmin, but not on an external IP or a php file.
Is there anything else I can try?
EDIT: I'm now getting this:
Connection failed: Can't connect to MySQL server on '9x.x.xxx.xx4' (110)
Is this something different, or the same?

Okay, I figured it out. In the my.cnf file it had this line:
bind-address: 127.0.0.1
I typed ifconfig into the Linux command prompt which gave me my local IP details. All I had to do is change it to that IP. Example:
bind-address: 192.168.0.X
Thank you to everyone to tried to help me out!
Edit: I really frown at my younger-self.
What would've been ideal is to actually put bind-address: 0.0.0.0, to have the MySQL server listen on all interfaces. But, I was 13 or 14, so ¯\_(ツ)_/¯

Related

Can't connect to MySQL server on 'IP' (111)

It is impossible to connect to mysql that I setup with phpmyadmin on a debian 8 VPS. I have been searching for hours, I have even followed this guide http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html but nothing, it seems imposible to get to connect to it, I even have created a phpmyadmin profile that is not on localhost and on %...
Thanks a lot for helping...
111 means connection refused, so make sure your mysql config is correct, and check your firewall.
Mysql config details (from Can't connect to MySQL server error 111):
If you have lines like this :
skip-networking
bind-address = 127.0.0.1
In your my.cnf configuration file, you should comment them (add a # at the beginning of the lines), and restart MySQL.
That's the first thing to try. Then try turning off any firewall and connecting again. That will tell you whether there's a firewall problem.

MySQL and Symfony2: Exceptions and Hair Loss

I've been attempting pretty much all day to get Symfony2's Doctrine configuration screen (e.g. /app_dev.php/_configurator/step/0) to connect to my locally running MAMP-provided MySQL instance. I've spent the day reading about sockets, skip-networking, and every other possible scenario but I'm at a loss. This is the error that you have most certainly seen before:
An exception occured in driver: SQLSTATE[HY000] [2003] Can't connect to MySQL
server on '127.0.0.1' (61)
And here are the various ways I have tried to correct this maddening problem:
I verified that I can indeed connect on the command line to both localhost and 127.0.0.1 using the mysql command. I made sure the ports were both filled in and not so I could see the results of an actual error.
I checked the socket while I was in there via SHOW variables LIKE 'socket' and saw it pointed correctly to my MAMP socket.
I've oscillated between the MAMP default ports and the standard MySQL ports (3306) just in case it was a weird port thing.
I made sure my /var/mysql and /tmp/mysql mysql.sock files were correctly symlinked to MAMP.
I commented out the skip-networking lines in MAMP's configuration file.
I toggled the "Allow Network Access" in every configuration possible
I added the line, unix_socket: /Applications/MAMP/tmp/mysql/mysql.sock, to my config.yml file just in case my symlinking trickery failed me.
I've done several rain dances and other tribal spells I read in a magazine trying to get this to connect.
I'm no stranger to development and MySQL but this has become a lost cause. Any help would be appreciated and rewarded with my unflinching respect for you.
The error code 2003 means "Can't connect to MySQL server", you can try to use the following methods.
Check your config file, is the parameters.yml can be access ? If you are on linux, just sudo chmod 777 /path/to/parameters.yml, and the mysql connection config parameters looks like this:
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1 or localhost
database_port: null
database_name: yourdbname
database_user: youraccount
database_password: yourpassword
Try to use localhost instead of 127.0.0.1;

Can't connect to mysql server on 'localhost' (10061) after replacing localhost at etc/hosts

I am adding the facebook authentication to my django application using the link http://goo.gl/hQ5nx5. I am using Wampserver for Mysql. There's a direction in the above link at step-4 to add an entry in the C:/Windows/System32/drivers/etc/hosts file that maps 127.0.0.1 to something like test1.com. But after this when I run my server through cmd, it gives the error: Can't connect to mysql server on 'localhost' (10061).
Kindly suggest me the solution to this problem. Thanks.
Is your settings.py pointing at localhost? You could adjust it
to point to test1.com, but that's likely to then cause issues when
you change back, so a better answer is:
/etc/hosts supports multiple hostnames for an ip address. You probably want a line like
127.0.0.1 localhost test1.com

connection to mysql server from clojure

I'm trying to connect to a mysql database from clojure. I'm using the example code taken from:
http://corfield.org/blog/post.cfm/connecting-clojure-and-mysql but I'm getting this error:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.
The mysql server is bound to 127.0.0.1:3306. Changing localhost to 127.0.0.1 in :subname doesn't help. I have set the mysql server to log everything for debugging, and it doesn't even see a connection coming. What am I doing wrong here?
I can connect to the db using mysql -h 127.0.0.1. But this fails to connect if I change 127.0.0.1 to localhost. my.cnf contains: bind-address = 127.0.0.1 and as I write above, changing to 127.0.0.1 in :subname doesn't help. The thing that did the trick was putting mysqld : ALL : ALLOW in /etc/hosts.allow. I have no idea why this is needed, especially when all the other services that contact the MySQL server work without it.

Mysql Workbench error "system error:61"

I have mysql installed several months ago. However I do remember using mysql workbench successfully at one point of time. Today I try launching it and get following error
Lost connection to MySQL server at 'reading initial communication packet', system error: 61
open /etc/mysql/my.cnf in a text editor and try changing:
bind-address = 127.0.0.1
to
#bind-address = 127.0.0.1
and then restart MySQL.
Try using the connection method: Local Socket/Pipe.
If you are trying to use the MySQL Workbench and connect through an SSH tunnel, you will get this error when your SSH connection does not complete successfully (e.g. improper host, password, key file, etc)
A good way to trouble shoot this is to separately test the the ssh connection from the machine you are trying to connect from and establish that you can do so succesfully.
I came across the same problem.I fix this below:
3306 port may be occupied by other process, so mysql change the port to 3307(or nearly other port 3308...).So when you connect,change the port to 3307 and try