I’d like to have sqlalchemy get the hostname, username, and password for the mysql database it’s connecting to.
The documentation says mysql schemas are specified as such:
mysql_db = create_engine('mysql://scott:tiger@localhost/foo')
Is it possible to instead source a mysql defaults file such as /etc/my.cnf and get the login details from there? I’d like to avoid embedding the username/password in my code.
Here is a result that was found on the sqlalchemy mailing list, posted by Tom H:
http://www.mail-archive.com/sqlalchemy@googlegroups.com/msg11241.html