While trying to connect google cloud sql from appengine-web2py it is giving
following error:
RuntimeError: Failure to connect, tried 5 times: Traceback (most recent
call last): File
"/base/data/home/apps/s~eappair-201601/20170131t082737.398849371354660874/gluon/packages/dal/pydal/base.py"
, line 446, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs)
File
"/base/data/home/apps/s~eappair-201601/20170131t082737.398849371354660874/gluon/packages/dal/pydal/adapters/base.py"
, line 60, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **
kwargs) File
"/base/data/home/apps/s~eappair-201601/20170131t082737.398849371354660874/gluon/packages/dal/pydal/adapters/mysql.py"
, line 96, in __init__ if do_connect: self.find_driver(adapter_args,uri)
File
"/base/data/home/apps/s~eappair-201601/20170131t082737.398849371354660874/gluon/packages/dal/pydal/adapters/base.py"
, line 192, in find_driver raise RuntimeError("no driver available %s" % str
(self.drivers)) RuntimeError: no driver available ('MySQLdb', 'pymysql',
'mysqlconnector')
1.
1. at __init__ (/base/data/home/apps/s~eappair-201601/
20170131t082737.398849371354660874/gluon/packages/dal/pydal/base.py:
473
<https://console.cloud.google.com/debug/fromlog?appModule=default&appVersion=20170206t051219&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~eappair-201601%2F20170131t082737.398849371354660874%2Fgluon%2Fpackages%2Fdal%2Fpydal%2Fbase.py&line=473&project=eappair-201601>
)
2. at __call__ (/base/data/home/apps/s~eappair-201601/
20170131t082737.398849371354660874/gluon/packages/dal/pydal/base.py:
174
<https://console.cloud.google.com/debug/fromlog?appModule=default&appVersion=20170206t051219&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~eappair-201601%2F20170131t082737.398849371354660874%2Fgluon%2Fpackages%2Fdal%2Fpydal%2Fbase.py&line=174&project=eappair-201601>
)
3. at <module> (/base/data/home/apps/s~eappair-201601/
20170131t082737.398849371354660874/applications/skf/models/common_cid.
py:6
<https://console.cloud.google.com/debug/fromlog?appModule=default&appVersion=20170206t051219&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~eappair-201601%2F20170131t082737.398849371354660874%2Fapplications%2Fskf%2Fmodels%2Fcommon_cid.py&line=6&project=eappair-201601>
)
4. at restricted (/base/data/home/apps/s~eappair-201601/
20170131t082737.398849371354660874/gluon/restricted.py:227
<https://console.cloud.google.com/debug/fromlog?appModule=default&appVersion=20170206t051219&file=%2Fbase%2Fdata%2Fhome%2Fapps%2Fs~eappair-201601%2F20170131t082737.398849371354660874%2Fgluon%2Frestricted.py&line=227&project=eappair-201601>
)
I have installed pip install mysql-python
Added following line to - app.yaml
env_variables:
CLOUDSQL_CONNECTION_NAME:
myproject-201601:us-central1:sqlabc-004-uscentral
CLOUDSQL_USER: root
CLOUDSQL_PASSWORD: cloudsqlpass
libraries:
- name: MySQLdb
version: "latest"
My connection string look like this:
db = DAL('google:sql://myproject-201601:us-central1:sqlabc-004-uscentral
/testdb')
Thanks,
Akand
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.