0

I have a system running on Google App Engine in Python with web2py. Before it was connected with a Google Cloud SQL database. Now I need it to connect to a database at DreamHost.

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

This generating me this error:

Traceback (most recent call last):   File "/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/restricted.py", line 220, in restricted     exec ccode in environment   File "/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/applications/frontend/models/b_db.py", line 12, in     }, Migrate_enabled = False, lazy_tables = True)   File "/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py", line 7867, in init     raise RuntimeError ("Failure to connect, tried% d times: \ n% s"% (attempts, tb)) RuntimeError: Failure to connect, tried 5 times: Traceback (most recent call last):   File "/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py", line 7845, in init     self._adapter = ADAPTERS [self._dbname] (** kwargs)   File "/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py", line 688, in call     obj = super (AdapterMeta, cls) .__ call __ (* args, ** kwargs)   File "/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py" line in 2728, in init     if do_connect: self.reconnect ()   File "/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py", line 648, in reconnect     self.connection = f ()   File "/base/data/home/apps/s~apollo-solutionworkshop/teste2.386857474473035619/gluon/dal.py" line in 2726, in connector     self.driver.connect return (** driver_args)   File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/MySQLdb-1.2.4b4/MySQLdb/init.py", line 81, in Connect     return Connection (* args, ** kwargs)   File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/MySQLdb-1.2.4b4/MySQLdb/connections.py", line 190, in init     super (Connection, self) .__ init __ (* args, ** kwargs2) OperationalError: (2005, "Unknown MySQL server host 'mysql-apollo-apollo.apollosolucoes.com' (-1)")

Putting that host more User and password, and database in the program SQLyog I can connect perfectly.

When the connection was made to go to the Google Cloud SQL database went like this:

'unix_socket' '/ cloudsql / apollo-solutionworkshop: apollosystem-main'
Sait
  • 19,045
  • 18
  • 72
  • 99
  • I hope you didn't post the actual login credentials here, in this public forum. – Kelly Keller-Heikkila Sep 02 '15 at 04:36
  • both as User password and the database name are fake – Henrique Apollo Soluções Sep 02 '15 at 18:23
  • Why there is no port specify in your connection string? – Richard Sep 04 '15 at 23:05
  • Even when I put the door did not work out. It was thus with the port. 'db = DAL ('mysql: // User: senha@mysql-apollo-apollo.apollosolucoes.com: 3306 / bancodedados' driver_args = {          }, Migrate_enabled = False, lazy_tables = True)' I'm closing this post, because I contacted the support of Dreamhost and they did an internal procedure to fix this problem. As I will not need more because the company changed what was to be done. I appreciate the help of all. – Henrique Apollo Soluções Sep 08 '15 at 12:46
  • You may consider deleting your question then... – Richard Sep 08 '15 at 15:24

0 Answers0