*Thank you LightDot !*
Your answer solved the problem immediately and elegantly:
When deploying to W2P with MySQL to PythonAnywhere = PA (and as LightDot
mentioned - possibly other hosting sites as well) - the DAL db connection
definition should be (*Italic* is LightDot elegant suggestion):
*db =
DAL('mysql://YourPAusername:[email protected]/YourPAusername$default')*
Note that on PA the name of database is actually *YourPAusername$default*
It connects right away but throws a ticket (discussed elsewhere on this
group) as *"1050 - Table thisandthat already exist"...*
Using the suggestion in the book (pay attention to caveat raised there) -
this is how eventually the connection worked for me...
*db =
DAL('mysql://YourPAusername:[email protected]/YourPAusername$default',
fake_migrate_all=True)*
Many thanks and may the Force be with you
NeoToren
On Thursday, January 23, 2014 8:29:48 AM UTC-5, LightDot wrote:
>
> AFAIK, the server name should be mysql.server, not
> username.pythonanywhere.com. The rest seems correct, including the
> username$default for the db name, which might seem odd to some.
>
> BTW, localhost is often used for a server name on various hosting
> providers, meaning that you are making a local connection to the mysql
> server that runs on the same host as your app. Remote connections to mysql
> servers are often blocked for extra security. I have never seen "localhost"
> used for a database name, as that would be confusing.
>
> Regards
>
>
> On Thursday, January 23, 2014 4:48:56 AM UTC+1, NeoToren wrote:
>>
>> I have managed to deploy to *PythonAnywhere* (*PA*) the MySQL database
>> in a matter of minutes!
>> Then I have re-created the Web2Py , uploaded and installed my application
>> from the localhost - literally 5 minutes !!
>> The familiar Web2Py interface was ready like a charm...so the description
>> of PA in the W2P book as the simplest solution was correct...
>> Life is good...All is great ...EXCEPT...
>>
>> What should be the *DAL - database connection definition* when *NOT* *on
>> a localhost *?
>> The definitions from the local machine obviously need to change. So I
>> have tried on PA in db.py:
>>
>> db =
>> DAL('mysql://*username:[email protected]/username$default
>>
>> <http://username:[email protected]/username$default>'*
>> )
>>
>> *username* = the PA username (tried *root* - of course didn't work)
>> *mysqlpassword* = the pwd for the mysql instance at PA
>> *username$default = * the database name which is equal to...
>> *username$default
>> *(tried *localhost* which didn't work)
>>
>> The above doesn't work and W2P cannot connect to MySQL...
>> I must be doing something really stupid since I am a newbie with W2P and
>> PA...
>> Any ideas ?
>>
>
--
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/groups/opt_out.