MariaDB and SQLAlchemy

3,781 views
Skip to first unread message

Margaret Tilton

unread,
May 19, 2015, 6:53:29 PM5/19/15
to sqlal...@googlegroups.com
Hello,

If there is documentation on this that I missed, please let me know. 

I have code that worked fine when I was using a MySQL database. My organization has switched to using MariaDB, which I was told was virtually identical to MySQL. It seems can connect to a MariaDB db using the following statement, which doesn't generate any errors:

    engine = create_engine('mysql+pymysql://[user]:[password@[server]/[db]', pool_recycle=3600)

Then the script tries to execute a simple select statement that worked fine on MySQL:
  
    check_for_table = "SELECT * FROM tb_metadata"
    table_result = session.execute(check_for_table)

At this point the script throws an error ("sqlalchemy.exc.OperationalError: (OperationalError) (1045, u"Access denied for user XXX")"

Any ideas? I would like to keep using SQLAlchemy if possible.

Thank you,

Meg

Mike Bayer

unread,
May 19, 2015, 7:04:21 PM5/19/15
to sqlal...@googlegroups.com
that issue is not within SQLAlchemy, it has to do with the configuration of the username which you are connecting with as well as the host configuration.      You should try testing first with the "mysql" command line client.    Take a look at https://mariadb.com/kb/en/mariadb/configuring-mariadb-for-remote-client-access/ for configuration instructions.




Any ideas? I would like to keep using SQLAlchemy if possible.

Thank you,

Meg
--
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+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Margaret Tilton

unread,
May 20, 2015, 12:33:16 PM5/20/15
to sqlal...@googlegroups.com

Michael,

Thanks for the response. The configuration of the username was indeed the problem!

Meg
Reply all
Reply to author
Forward
0 new messages