Here is the code I am using MySQL_Python 1.2.3 with Python 2.6

db = create_engine('mysql://root:passw...@localhost/dbase', echo = True)

metadata = MetaData()

user = Table( 'user',metadata,
    Column('id'         ,Integer, primary_key = True),
    Column('password'   ,String, nullable = True    ),
    Column('user_name'  ,String, nullable = True, unique = True  ),
    Column('real_name'  ,String, nullable = True    ),
    Column('email_addr' ,String, nullable = True, unique = True  ),
    Column('address'    ,String, nullable = True    ),
 
)

try:
    metadata.create_all(db)
except Exception,err:
    print err
    exit(1)

morecowbell wrote:
> it should. how/where are you setting up the tables? can you post the
> essential parts of your code?
>
> On Mar 22, 9:11 pm, pete.do...@gmail.com wrote:
>   
>> I am having trouble connecting to mysql database. I keep getting
>> Programming error 1146 after trying to do a metadata.create_all(). I
>> created the schema, but it has no tables I thought the create_all
>> would make the tables
>>     
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to