I have a Facebook app running on Heroku. The app has been created directly from the Facebook app creation wizard. The subdomain is like myapp.herokuapp.com. The problem is when I connect to an external MySQL DB, another subdomain (amazonaws) is presented to the MySQL server. This is the answer of MySQL server, which does not grant access because of unknown domain.
Could not connect: Access denied for user 'mauro_wrdp2'#'ec2-23-22-65-197.compute-1.amazonaws.com' (using password: YES)
What do I need to do to have herokuapp subdomain presented instead on Amazon AWS?
You can't connect through your Herokuapp domain to your AWS instance - Postgres (not Mysql) runs separately to the applications which is why you have to connect directly to the AWS instance. I guess you would be free to CNAME your own domain to the AWS address but you run the risk of the DB being moved - Heroku would update the DATABASE_URL config variable on your behalf if this happened.
Related
I have a sails js app running on App Engine and a Cloud SQL instance that App Engine is supposed to talk to. I am using the following configuration with Sails v1.0 app:
adapter: 'sails-mysql',
socketPath: `/cloudsql/${process.env.INSTANCE_CONNECTION_NAME}`,
user: process.env.SQL_USER,
password: process.env.SQL_PASSWORD,
database: 'parsley'
All of the env variables are passed correctly but I still get this error:
name=AdapterError, adapterMethodName=create, modelIdentity=admin, name=Exception, code=badConnection, exit=badConnection, errno=ECONNREFUSED, code=ECONNREFUSED
If you are testing the code using the Cloud Shell and using a Cloud SQL Proxy:
Start the Cloud SQL Proxy in a Cloud Shell tab and leave the tab opened
Open a new tab. Try to connect from App Engine to Cloud SQL.
As described here:
Your application communicates with the proxy with the standard
database protocol used by your database. The proxy uses a secure
tunnel to communicate with its companion process running on the
server.
If you don't leave the Cloud SQL Proxy running in a tab, the secure tunnel is not created and is not possible to access Cloud SQL.
There are other issues that can cause this problem but according to the research I did "googling" the error, this looks like the most common.
I have set up 2 projects in my Google Cloud console. The following are the two projects that I have set up in my console.
1. Cloud SQL + App Engine
2. App Engine (New)
So the idea is App Engine (1) is running the same database as App Engine (2). I have already set up the IAM Permission Page and IAM Admin and Project Page.
I have given both projects as Project Editor role too, but still my (2) still can't connect to my (1) database.
Any help please?
Granting access to an application does not automatically enable a database user account to connect to the instance.
You may connect through a proxy, in which case you should follow these steps:
Enable the API
Install the proxy client on your local machine
Determine how you will authenticate the proxy
If required by your authentication method, create a service account
Determine how you will specify your instances for the proxy
Start the proxy
Update your application to connect to Cloud SQL using the proxy
You can find related details on the Connecting to Cloud SQL from External Applications.
This documents provides steps that cover configuring access for IP connections as well.
If you connect from within the app engine environment, you may have a look at Connecting from App Engine.
I have hosted a webapp in azure cloud.
My MS sql database is in rackspace which only allows a selected ip to access.
I can add more IPs to allow access to the rackspace database.
Which IP address of the Azure webapp should I add in rackspace?
Is it the customDomain's IP address or something else.
There isn't just one - check out this doc - basically Azure Web Apps run in a server farm that's managed by Microsoft. Unless you use an ASE (app service environment) you can't change this. There are a couple of ways you can do what you're trying to do - either
1 - connect over the internet by opening up the ports on your rackspace VM - this will work, but opens you up to the possibility of a network layer attack from any app that someone hosts in Azure. (so you're relying on authentication rather than network level protection).
2 - use a hybrid connection - this is an app service feature that allows you to download a gateway exe app that runs in your VM in rackspace, and then connects to the app service and creates a secure tunnel to it. Hence, its outbound from your rackspace DC, you don't need to change firewall settings. You can read about it and download the app from the azure portal (in app services). You then configure the connection in your azure web app just as if the rackspace VM was on the same network. (eg. you can use "localhost" if the gateway exe is running on the sql server). This is the approach I'd recommend if you can't move your SQL estate to Azure SQL and hence locate it alongside your web apps.
I have a Google Cloud SQL project : cwdataproject (Project ID). I have created a schema named cwdb in it. Its Instance ID is : cwdataproject:cwinstance
I have provided access and privilege to cwdb for root user "root"
I have another app Google App Engine : messageframework (Project ID)
Project ID: messageframework
I have provided Authorized App Engine Applications in cwdataproject for messageframework
I have provided Authorized Networks for my local IP. and I am able to connect from local My SQL client successfully.
My code to connect Google Cloud SQL from messageframework app is as below.
Code:
Class.forName("com.mysql.jdbc.GoogleDriver");
url = "jdbc:google:mysql://cwdataproject:cwinstance/cwdb?user=ajoysinha;
DriverManager.getConnection(url);
But is is giving the following error
Access denied for user 'root'#'localhost' (using password: NO)
How can we resolve this connectivity problem?
I am able to connect Cloud SQL from my local MySql client and do all the operation. but not from GAE.
I have an application on google app engine servers and private master server behind firewall. Accesss to master server closed by default. So I want to open access for my GAE app. Application sends by XML-RPC requests to master server. How can I do what? How to add GAE servers to my firewall access list?
From http://code.google.com/appengine/docs/python/urlfetch/overview.html#Secure_Data_Connection:
"Your application can connect to systems behind your company's firewall using the Google Secure Data Connector (SDC). With the SDC Agent set up on your network, App Engine applications running on your Google Apps domain can authenticate with the Agent and access URLs on your intranet. The SDC Agent ensures that only your applications can connect to your intranet, and that they will do so only for users signed in using an Apps account on your domain."
If not for GAE, you could use Reverse Port Forwarding Wizard:
http://www.upredsun.com/reverse-port-forwarding/reverse-port-forwarding.html