excellent; thanks!

On Monday, September 29, 2008 4:48:18 PM UTC-5, Tom H wrote:
>
> Depending on security preferences, it may be desirable to keep 
> database passwords out of code files. 
>
> One of the recommendations for MySQL is to keep the password in 
> a .my.cnf file accessible only to the user. 
> http://dev.mysql.com/doc/refman/5.0/en/password-security.html 
>
> To use the .my.cnf password in sqlalchemy, do something like the 
> following: 
>
> from sqlalchemy.engine.url import URL 
> myDB = URL(drivername='mysql', host='localhost', 
> database='my_database_name', 
>   query={ 'read_default_file' : '/path/to/.my.cnf' } ) 
> engine = create_engine(name_or_url=myDB) 
> # use the engine as usual, no password needed in your code file :) 
>
> This has been very useful to me, hopefully others find it helpful as 
> well.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to