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.