PhpStorm + MySQL Setup - mysql

I have been trying to set up a new MySQL connection in PhpStorm (2016.1) for days now and cannot figure it out.
I am on a Mac OS X 10.11.4 and I have a Home Server (Ubuntu 14.04) and MySQL (5.5). I have a Firewall setup on the Server and have allowed all local connections to pass through (verified by connecting to MySQL on another computer).
I went into PhpStorm and added a new Database, entered the IP address (even tried host name) of remote (Home Server), and all credentials. When I hit "Test Connection" I get an error of
"Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection Refused"
I have "googled" about this error and one suggestion is to uncomment the localhost line in your hosts file (it was never commented out). I then though, maybe I need to have MySQL installed on my Mac, so I installed the current MySQL. Still get the same error. I even went under the SSH tab (PhpStorm) under the database setup and tried to set up a SSH Tunnel, still the same error.
Any suggestions?

(Posted on behalf of the OP).
After talking with JetBrains they were able to help me out. For some reason an address within my /etc/hosts file (on my Mac) was messing the connection up. Once I removed it, it connected. Somehow one of the IP addresses was making it loop back to localhost.

Related

How to resolve a "max_allowed_packet" error when connecting PyCharm to a remote MySQL db via SSH?

I want to be able to connect to and work with a MySQL database that I have on DigitalOcean via PyCharm's database interface (instead of MySQL Workbench, which is what I'm currently using), but when I try to use PyCharm's interface to connect, I get the following error when I click 'Test Connection':
Packet for query is too large (###### > ######). You can change this value on the server by setting the max_allowed_packet' variable.
I'm connecting to DigitalOcean via SSH, and PyCharm is saying that my SSH connection is OK (it's working).
The issue ended up being that I was putting the wrong IP address and port into PyCharm's prompt: I was putting the IP address to my DigitalOcean VM instead of the local IP address of the MySQL db.
Here's a screenshot of the PyCharm settings that ended up working (remember, I was connecting via SSH):
Here's a screenshot of my (working) MySQL Workbench settings, showing which settings I should have copied over to PyCharm:

"Cannot Connect to Database Server" error connecting from MySQL Workbench to SiteGround MySQL Database

Situation:
I am trying to connect to my SiteGround server MySQL database directly from my local machine using MySQL Workbench. I am positive that the connection properties are entered correctly as the connection works if I am connected to Network A (phone data plan). But with Network B, the connection failed.
I allowed remote access to my server from my Network B IP, in fact, I allowed all IPs just for testing, therefore Network A is working.
I checked if there is any setting that blocks the port from my router and modem in Network B, but I found nothing.
I tried running netstat: nothing with port 3306.
I tried running telnet: "connect failed"
Question:
I am suspecting that my ISP has blocked the outgoing port 3306? Is there anything I can do to "unblock" it?
Or is there any workaround for connecting to my server database?
My connection set up screenshot:
Error screenshot:
Thank you in advance for your time and help!!

MySQL Workbench Failing to Connect to Server (Windows)

There are many errors I have found across the web that deal with MySQL connection errors, but I have found none that address this specific problem that I am having. In short, I have the newest version of the MySQL Server installed (8.0), I have verified it is running in my Services tab, and I can connect to the server via the MySQL client just fine. However, I cannot open a local connection in Workbench.
When I click on the local instance, it hangs until I manually stop it. I then get the aforementioned error
I then went and ran a diagnostic of the server in the MySQL Installer, which reported that everything is working fine (unless I am reading it wrong)
The logs of said diagnostic also report that the server is installed, functional, and running.
I then checked made sure the server was running in Services
After that, I verified that I could connect to the client, and that I could use the database I was working with (info redacted due to it being company property lol)
Additionally, I also made a new connection on Workbench on port 3307 instead of the standard 3306.
When I click on this, I can enter into the connection without getting the "Cannot access a disposed object" error. However, this connection still cannot connect to the server.
I also saw that some people were having success by navigating into C:\Program Files\MySQL\MySQL Server 8.0\bin and running mysqld --install. This appeared to be beneficial, but ended up doing nothing.
Does anyone know how I can fix this without completely uninstalling everything? Everything was working fine yesterday but has suddenly stopped as of this morning.

SSH tunnel to MySQL database

We're in the process of setting up Tableau connectivity to our company's sales database and so far, the people that have been attempting to connect (they're from some other company) keep getting denied. The errors they're getting are as follows.
Unable to connect to the ODBC Data Source. Check that the necessary drivers are installed and that the connection properties are valid.
Can't connect to MySQL server on '[IP address] (61).'
Unable to connect to the server '[IP address].' Check that the server is running and that you have access privileges to the requested database.
Today we opened ports 3306 and 20560. We were hoping we could set up some kind of port forwarding thing so that they connect to 20560. I'm not sure what we need to do to set that up, however. I was also told that SSH tunneling is an option, but connecting with PuTTY doesn't yield any results.
I'm at a complete loss as to what I need to do to allow them to connect. I'm also not sure that opening port 3306 is safe and I'd like to know if I should have it closed. I randomly picked port 20560 because it's not being used for anything. We don't want just anyone to connect, but I've been told that the IP address connecting to our database may not be static.

How to fix 'Can not connect to MySQL server' error?

First of all I apologize for my English is not perfect.
I'm trying to connect to mysql database remotely.
I have already done the basic steps such as, for example, comment the bind address in my.cnf.
I gave permissions to the appropriate users in MySQL.
I tried with my friend to do it connect to the database, and it worked but we were in the same room with the same router.
Now I'm home and I tried to connect my friend, but I always get error:
ERROR 2003 (HY000): Can not connect to MySQL server ....
Maybe it's a problem of my home router? I can not even do the telnet.
P.S. I've also taken steps to set the firewall.
Some reasons for that,
mysqld is not running on the local host. Check your operating
system's process list to ensure the mysqld process is present.
You're running a MySQL server on Windows with many TCP/IP connections
to it. If you're experiencing that quite often your clients get that
error, you can find a workaround here: Section B.5.2.2.1, “Connection
to MySQL Server Failing on Windows”.
Check whether the server is running on that host by executing telnet
some_host 3306 and pressing the Enter key a couple of times. (3306 is
the default MySQL port number. Change the value if your server is
listening to a different port.) If there is a MySQL server running
and listening to the port, you should get a response that includes
the server's version number. If you get an error such as telnet:
Unable to connect to remote host: Connection refused, then there is
no server running on the given port.
Look at this mySQL full documentation, it will be helpful.