Google Cloud SQL Connection/Permission Failures - mysql

Having trouble with the final steps of this wordpress launcher guide from google.
I've built my page on the localhost and happily pressed "deploy" then eagerly waited for my little bird to fly. Imagine my chagrine when it feel lame, unable to connect reach it's friend, the google cloud sql servers.
First I tried to fix it by using the command supplied by google here:
mysql --host=instance-IP --user=user-name --password
But I was greeted with only
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '--host=ip --user=name --pass' at line 1
I tried a number of different versions to no avail. I searched the forums which suggested using mySQL workbench, a tool with which I am familiar.
Here too I was met with numerous errors.
Failed to Connect to MySQL at 2601:4:2d80:a6f:10ff:c984:174e:f135 :0 with user root
Both for reasons (0)
and for reasons (2)
Unknown MySQL server host 'ip-address' (2)
Error 0 is supposed to be, according to google:
If Google Cloud SQL rejects the connection, for example, because the IP address your client is connecting from is not authorized, [this will be the] error you receive
That doesn't make sense because I've a) given them my ip and b) there currently is no password (cleared it out while trying to figure out what could be wrong).
Basically I'm at my wits end. I've looked around fairly extensively (I've spent the last 6 hours trying to fix this) and can't get what seems like it should be something fairly simple to work.
Basically what I'm saying is: help me stack overflow, you're my apps only hope.
thanks.

Ok, final solution! basically after so many attempts I isolated it down to being that the cloud sql wasn't accepting my ip address.
This narrowed my thinking to a) I hadn't entered the correct ip address (logical), or b) I was behind a proxy and didn't know it.
I ran ipconfig and then entered every possible ip from that, as well as the standard "what is my ip" google search and entered that as well. No dice. This lead me back to option b) firewall or proxy. I searched "am I behind a proxy"? which lead me to link.
This returned a different IPv4 than the google "what is my ip" address, I entered that and success! it worked. Why this different ip address worked where the google search and ipconfig search did not is beyond me, so anyone chiming in here about why/where to find it consistently are very welcome.

Related

Unable to connect to RDS using MySQL Workbench

I have read countless guides and threads on how to connect to RDS database with MySQL Workbench and I do exactly as specified (I believe), but I still haven't managed to get a connection.
There must be something I am overlooking and simply don't understand. Let me know if I need to give more information. Any help is much appreciated. Thank you!
I have made sure that public accessibility is set to yes. Here is a summary of my database in RDS:
And the configurations of my database:
I try to connect to the database with Standard (TCP/IP):
And get the following error every time:
For some reason nothing happens when I click "Test Connection", but at one point I got the error 10060. Don't know if this helps though. I tried googling it but none of the solutions worked for me.
I have been stuck at this for some time now and simply don't understand what I am doing wrong.
Thank you very much,
cheers
You might have not open the port (3307) for your ip address in the used security groups.
Check the used security groups for inbound rule, allowing traffic to port 3307 from your ip address.
Simply click on the security group to get to the configuration page.
Here a hint:
Screenshot of how to add a rule to a security group

Google Cloud SQL ER_HOST_IS_BLOCKED

i'm getting some issues connecting to Cloud SQL from Container engine...
I followed https://cloud.google.com/sql/docs/container-engine-connect tutorial and it all seems to work, though I had to tweak a few things with the password/user stuff being sent.
However after several failed attempts of the container trying connect using Cloud SQL Proxy I am now seeing this error ER_HOST_IS_BLOCKED: Host '104.197.135.204' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
FLUSH HOSTS; doesn't seem to fix it.
and I'm unable to change the max_connect_errors value since root doesn't have the super privilege & it's not part of the MySQL flags customizable https://cloud.google.com/sql/docs/mysql-flags
any thoughts?
Got some answers through Google Cloud SQL Slack channel. It was actually related to a different database
However, I did learn that the ER_HOST_IS_BLOCKED is reset whenever a successful connection is made so this should never be an issue

DB2 Connect issue using Native OLE DB\MS OLEDB Provider for DB2

I downloaded and installed the driver setup file, DB2OLEDB.exe, from here:
http://download.microsoft.com/mwg-internal/de5fs23hu73ds/progress?id=HYLbKUfGNl
Using the connection string that worked on another PC, I tried to create a Connection Object in an SSIS package. When I tested the connection I got this error:
Test connection failed because of an error in initializing provider. A TCPIP socket error has occurred (10057): A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
Any suggestions on what the cause of this error is and how I might resolve this issue?
By the way, when I use the DB2 Configuration set up utility and test a connection from within that, I am able to successfully connect.
What other info can I provide to help you answer this question?
Thank you
Could this be related to a blocked port?
If you follow all the steps illustrated here: http://www.bidn.com/blogs/PatrickLeBlanc/ssis/700/connecting-to-db2-using-ssis do you still get the same result?
Maybe a silly question, did you restart the computer after the installation?
Are you an admin user on one machine and not on the other?
You could try to verify the port connectivity with a quick telnet command:
telnet your-db-host your-db-listening-port
If it connects, that one is off the list.
Doing some research I've found two possible fixes.
The first link suggests calling BeginReceive after the EndAccept logic is complete. Are you using script code, or just using the GUI without any scripting?
TCP async sockets throwing 10057
The second link points to drivers / software on the PC. It could be that you are missing a windows update or have faulty hardware / drivers.
I think this is less likely the case since you could connect to a different machine with the same connection string(?). Can you verify this is a valid statement?
http://social.msdn.microsoft.com/Forums/en-US/1bc3df95-c86d-4d25-aa20-30f61ed00c63/odd-socket-errors
If you could show the connection strings used for both the working and non working, and give a little more detail about The "Other PC" in comparison to the non-working PC... that would be helpful =]
If neither of the posts I've linked are the solution, this specific Google search has proven to yield some seemingly helpful results
"socket" "10057" "no address was supplied."

What is the root error behind "Failed to establish a database connection. Check connection string, username and password."

Looking through google and stackoverflow, I found a number of questions asking about "Failed to establish a database connection. Check connection string, username and password." However, I cannot find anyone that has found what the underlying error is.
I am trying to write my first google script with a database connection; I have a mysql and oracle jdbc getConnection, both of which spawn this error. I have checked, double- and triple-check the connection information to no avail. I know the databases are accessible (can get in through other clients from several different machines like php on a linux box, sql developer on various windows PCs at home and work). How do I determine what the real error is? The error as presented to me is way too generic and abstract.
Environment:
Using a script in a Google Spreadsheet (thus inheriting whatever environment is established by google). I am attempting to use the Google API jdbc and have no further knowledge of the environment variables.
Using the following syntax:
var url = "jdbc:mysql://mysql.cb-pta.com:3306/u4lottery";
var conn = Jdbc.getConnection(url, user, password);
Again, user and password have been verified.
There is a known bug which causes problems with jdbc connections using hostnames. Try using an Ip address instead.
Bizarre, but true.. I lost almost 2 days with this bug....
Here is the link to the bug report....
Just for sake of others finding this older thread. I also had trouble using Apps Script to connect to a Google CloudSQL instance, and had to change from:
Jdbc.getCloudSqlConnection('jdbc:google:rdbms://<IP>/<DB_NAME>', '<USER>', 'PASSWORD');
to standard JDBC MySQL (which worked):
Jdbc.getConnection('jdbc:mysql:// ...same as above...
Also, beware and DO NOT include a '/' behind the DB_NAME - this will also cause failure with user/passwd error message!
One more thing to check is that you have proper firewall settings - to allow access from the source IP you are coming from (in the event of Apps Script, this is likely Google's servers - not you client browser's IP). You may have to open it up to all (0.0.0.0/0)
It might have something to do with your database being behind a firewall. According to Google documentation (in this case, Google Data Studio, but generally applicable): "If your database is behind a firewall, you will need to open access to the all of the following IP addresses. These are used by Data Studio to connect to and query your MySql database."
IP addresses here among other places: https://support.google.com/datastudio/answer/7088031

Cannot connect to SQL Server 2008 Error 18456 Login failed for user

I'm trying to connect to our SQL Server box from our web server. The only thing i've been able to find regarding the issue is to enable tcp/ip and mixed authentication.
TCP/IP is already enabled
Mixed authentication mode is selected
we already have 1 user successfully connecting to a different database so I know TCP/IP and mixed authentication are working.
Logging in as the problem user from sql manager works fine.
I get the same error creating an ODBC connection as well as a ColdFusion SQL Server data source.
According to the log files, which isn't logging all the attempts also indicates State 40, which is "Default database could not be accessed (SQL 2008)."
I've check and the default database is the one I want to open. The Schema is DBO.
Any help would be appreciated.
Make sure your user password not longer than 16 characters.
I apologize for not answering this sooner. To be honest I completely forgot about the question until I got a 'Notable Question' badge from it. Unfortunately, I'm afraid it won't help anyone as the problem was caused due to bad information from the network admins. They moved our SQL server to another box but did not shut down the old instance. Essentially, they gave me the old IP to connect to. Once I got the correct IP to the new box everything worked perfectly. The user I thought was connecting was an older account that was already established prior to the 'move' so the account existed on the old box.
If your box has multiple IP's on it, make sure the Cold Fusion server's IP address (that it's binded to) is allowed access to the SQL box. I've come across this problem in the past. I don't know if you're using a firewall or not to restrict access...but this was a problem I've encountered in the past.