Web2py未与我的MySQL数据库

时间:2015-09-02 01:23:11

标签: python connection web2py dreamhost

我有一个使用web2py在Python App Engine上运行的系统。 在与Google Cloud SQL数据库连接之前。 现在我需要它连接到DreamHost的数据库。

db = DAL ('mysql: // User: senha@mysql-apollo-apollo.apollosolucoes.com/bancodedados' driver_args = {
        }, Migrate_enabled = False, lazy_tables = True)

这就产生了这个错误:

  

Traceback(最近一次调用最后一次):文件   “/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/restricted.py”   第220行,受限制   exec ccode在环境文件“/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/applications/frontend/models/b_db.py”中,   第12行,在   },Migrate_enabled = False,lazy_tables = True)文件“/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py”,   第7867行,在 init 中   引发RuntimeError(“连接失败,尝试%d次:\ n%s”%(尝试,tb))RuntimeError:连接失败,尝试了5次:   Traceback(最近一次调用最后一次):文件   “/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py”   第7845行, init   self._adapter = ADAPTERS [self._dbname](** kwargs)文件“/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py”,   第688行,致电   obj = super(AdapterMeta,cls).__ call __(* args,** kwargs)文件   “/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py”   2728行, init   if do_connect:self.reconnect()文件“/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py”,   第648行,重新连接   self.connection = f()文件“/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py”   在2726年,在连接器   self.driver.connect return(** driver_args)文件“/base/data/home/runtimes/python27/python27_lib/versions/third_party/MySQLdb-1.2.4b4/MySQLdb/init.py”,   第81行,在Connect中   return Connection(* args,** kwargs)文件“/base/data/home/runtimes/python27/python27_lib/versions/third_party/MySQLdb-1.2.4b4/MySQLdb/connections.py”,   第190行,在 init 中   super(Connection,self).__ init __(* args,** kwargs2)OperationalError:(2005,“Unknown MySQL server host   'mysql-apollo-apollo.apollosolucoes.com'( - 1)“)

将主机更多用户和密码,以及程序SQLyog中的数据库我可以完美连接。

当建立连接到Google Cloud SQL数据库时,就像这样:

'unix_socket' '/ cloudsql / apollo-solutionworkshop: apollosystem-main'

0 个答案:

没有答案