Is it possible to use Mysql with SqlAlchemy and Flask if my mysql socket isn't in /tmp?

You'll have to dig up the exact syntax, but for MySQL I think they use a unix_socket query opt. Something like:

mysql:///dbname?unix_socket=/opt/mysql/mysql.sock'

Should be your connect URI for SQLAlchemy.


Yes! Sean was right

app.config['SQLALCHEMY_DATABASE_URI'] = ''mysql://dayenu:secret.word@localhost/dayenu?unix_socket=/usr/local/mysql5/mysqld.sock
db = SQLAlchemy(app)

works fine! I think this parameter is used by pyodbc, which is what SQLAlchemy uses to talk to mysql, but I couldn't find this parameter anywhere in the pyodbc documentation.