-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google app engine with sockets #457
Comments
I'm pretty sure the solution has something to do with https://godoc.org/github.com/go-sql-driver/mysql#DialFunc But I can't get it to work |
When I try to connect to an external database the 'normal way' without
When I try connecting like this (abridged):
and change my dataSourceName = something like: "id:password@external(your-amazonaws-uri.com:3306)/dbname" I get this error:
My app is a paid google app engine-standard environment app hence sockets are available. |
I couldn't get it to work so I reverted back to CloudSQL. Even if my post is 2+ years old and you find a solution please tell me so I can change over. |
A significantly slower solution would be to fork this package so that it can interact with MYSQL's REST API interface which communicates using json. That would probably be slow though. GAE would definitely allow it using |
@julienschmidt any ideas? |
@pjebs that doesn't look very promising... https://github.com/GoogleCloudPlatform/appengine-sockets-python-java-go/tree/master/go_socket_demo (README with "will be added soon" in a 4 year old commit) Best of luck, but you are on your own. If you do find something, we'd love to know how it's done. But...
|
Would you be able to keep it open for a bit longer - perhaps a week? |
sure |
Thanks |
https://cloud.google.com/appengine/docs/go/using-third-party-databases#other_cloud_providers This article says it's possible for standard environment but doesn't specifically say you have to use sockets. @arnehormann Do you think there may be another way? The tone of the article really suggests they are doing their best to hide how to do it to keep you on CloudSQL. |
@pjebs I can't help with this issue. I am not an AppEngine or CloudSQL user and have no idea about it. |
@arnehormann and @FutureReaders I have worked out how it is done. It is done via the code above:
change my dataSourceName = something like: The reason why it didn't work before was because I had a cloud sql server and to test trying to connect to an external database, I just used the cloud sql server's public ip address. Apparently the cloud sql server's IP address is blocked by Socket API hence it didn't allow it, leading me to think my approach was wrong! A cloud sql database can only be connected via: |
I attempted to work around If anyone wants to help go ahead. |
@pjebs I'm commenting from the future to say that socket.Dial is exactly what I needed for an issue not related to SQL but rather Redis. Thank you! |
I've been using CloudSQL but it it very expensive.
I found out recently that you can connect to a external MySQL database using sockets on gae (paid app)
https://cloud.google.com/appengine/docs/go/sockets/reference#Introduction
Is there some way to get the socket interface to work with this package?
The text was updated successfully, but these errors were encountered: