External MySQL using Standard Environment

51 views
Skip to first unread message

pj

unread,
May 20, 2016, 10:16:02 PM5/20/16
to google-appengine-go
I don't seem to be able to connect to an external MySQL database even using socket API.

Stuart Langley from GAE-PHP says it is possible: http://stackoverflow.com/questions/26322445/connecting-external-mysql-to-google-app-engine

https://github.com/go-sql-driver/mysql/issues/457

When I try to connect to an external database the 'normal way' without appengine/socket I get this error:

error: dial tcp 173.388.532.444:3306: socket: operation not permitted

When I try connecting like this (abridged):

"google.golang.org/appengine"
"github.com/go-sql-driver/mysql"
"google.golang.org/appengine/socket"

dial := func(addr string) (net.Conn, error) {
        return socket.Dial(appengine.NewContext(r), "tcp", addr)
    }

mysql.RegisterDial("external", dial)

and change my dataSourceName = something like: "id:password@external(your-amazonaws-uri.com:3306)/dbname" I get this error:

error: API error 5 (remote_socket: PERMISSION_DENIED): connection to (2, 173.388.532.444:3306,6) denied due to policy

My app is a paid google app engine-standard environment app hence sockets are available.


Message has been deleted
Message has been deleted

pj

unread,
May 21, 2016, 2:48:03 AM5/21/16
to google-appengine-go
The documentation for GAE-Standard Environment definitely says it is possible. For obvious reasons, they are hiding how to do it!

https://cloud.google.com/appengine/docs/go/using-third-party-databases

pj

unread,
Jun 29, 2016, 12:45:14 AM6/29/16
to google-appengine-go
Reply all
Reply to author
Forward
0 new messages