googleappengine+mysqldb

495 views
Skip to first unread message

Smita Korgaonkar

unread,
Aug 16, 2011, 2:48:18 AM8/16/11
to Google App Engine
I installed MySQLdb in python2.6. Using python 2.6 I run application
which was developed in googleappengine.
I import that using statement

import MySQLdb
I got following error

ImportError: No module named MySQLdb

[ This module available when I import from python prompt ]
What can I do for that

Tim Hoffman

unread,
Aug 16, 2011, 3:41:51 AM8/16/11
to google-a...@googlegroups.com
Hi

Mysql db backend isn't available inside the appengine environment.  (There will be an option some day)

Alternately if your trying to connect to a remote mysql db (outside appengine) you would need a pure python 
implementation as most mysql client libs are based on c extensions.

However even if you had one of those (here is one https://github.com/petehunt/PyMySQL/wiki/PyMySQL:-Pure-Python-MySQL-Client)
it wouldn't do you a lot of good as mysql wire protocol isn't based on http (all outgoing connections need to be fundamentally based on http)

So you would need a http abstraction layer (or rest interface or something else) to connect to some remote mysqldb.

I think you need to have a read of the overview and getting started for appengine. I might give you a better idea about what you can/can't do 

Rgds

Tim

P.S. Save your self some problems and use python 2.5 (ad then skip to 2.7 when support for it comes out)

Smita Korgaonkar

unread,
Aug 16, 2011, 2:45:41 AM8/16/11
to Google App Engine

Robert Kluin

unread,
Aug 16, 2011, 12:37:40 PM8/16/11
to google-a...@googlegroups.com
You can't use modules based on c-extensions with App Engine. You can
also only communicate via http, so it wouldn't matter even if you
could.
http://code.google.com/appengine/docs/python/runtime.html#The_Sandbox

They are planning SQL support in the 'near' future. Tobias Rodäbel
has put together a nice example of how to use it. Note that this will
not work on production yet.
https://github.com/rodaebel/simplenotes


Robert

> --
> You received this message because you are subscribed to the Google Groups "Google App Engine" group.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages