MySQL reflection depends on DESCRIBE being available so if that's not
possible you'd have to forego having these tables be reflected, instead
you'd have to code the columns you care about in the application.


On Dec 25, 2016 3:55 AM, "Ben Mishkanian" <shamitat...@gmail.com> wrote:

> Hello,
>
> I am having an issue similar to the one described in this unanswered
> StackOverflow question.
> <http://stackoverflow.com/questions/27556329/sqlalchemy-reflection-on-dbs-with-limited-permissions>
>  My
> issue is that I need to load the data from a table where the SELECT
> permission is denied for a couple columns. I only want to load the data for
> the columns where I do have SELECT permission. I tried this:
> table = Table(tableName,metadata, autoload_with=engine, schema=schemaName,
> include_columns=['allowedColumn1'])
> but it gave this error:
> sqlalchemy.exc.ProgrammingError: (mysql.connector.errors.ProgrammingError)
> 1142 (42000): SHOW command denied to user 'username'@'localhost' for
> table 'tableName' [SQL: 'SHOW CREATE TABLE `databaseName`.`tableName`']
> I think this is because MySQL requires the user to have full SELECT
> privileges in order to do SHOW CREATE TABLE, but the documentation is not
> clear about this, vaguely saying "you must have some privilege for the
> table" <http://dev.mysql.com/doc/refman/5.7/en/show-create-table.html>.
>
> Is there some way for me to work around this? I cannot ask for any
> privileges for the protected columns, but I may be able to convince the
> administrator to give me other read privileges if necessary. Ideally
> though, I would like a way to reflect the allowed columns without having to
> change any MySQL settings.
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

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

Reply via email to