sqlacodegen giving Unknown database on mysql+pymysql

260 views
Skip to first unread message

Andy Andurkar

unread,
Feb 24, 2023, 8:12:18 AM2/24/23
to sqlalchemy
I am getting the following error while using sqlcodegen with mysql
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1049, "Unknown database 'engine(mysql+pymysql://xxx:***@localhost:3306/mydb)'")

[SQL: SHOW FULL TABLES FROM `Engine(mysql+pymysql://xxxx:***@localhost:3306/mydb)`]

Mike Bayer

unread,
Feb 24, 2023, 12:01:38 PM2/24/23
to noreply-spamdigest via sqlalchemy
Please refer to https://github.com/agronholm/sqlacodegen/discussions for sqlacodegen support.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
 
 
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
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.

Val Huber

unread,
Feb 27, 2023, 12:15:56 PM2/27/23
to sqlalchemy
Hi, Andy

I share your interest in sqlacodegen.  I am using it heavily in API Logic Server, and did in fact need to make some changes.

So, you might want to consider using it.  If all goes well, you'll not only get your models.py, you'll get an API and an Admin App.

Hope that helps,
Val

Reply all
Reply to author
Forward
0 new messages