[sqlalchemy] Re: MySQL error
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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: MySQL error
since you're using mysql you got specify the the length for each string, e.g., String(40); http://www.sqlalchemy.org/docs/05/ormtutorial.html#define-and-create-a-table On Mar 23, 1:49 pm, Peter Douma pete.do...@gmail.com wrote: 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 -~--~~~~--~~--~--~---
[sqlalchemy] Re: Can't connect to local MySQL server
make sure your mysqld.sock is in the location mysql expects it to be. default is /tmp/mysql.sock; if you are using darwinports, depending on mysql version it's /opt/local/var/run/mysqld/mysqld.sock (append mysql version to mysqld). otherwise, head over to forums.mysql.com ; i'm pretty sure that's a recurring topic On Oct 9, 10:32 am, Heston James - Cold Beans [EMAIL PROTECTED] wrote: Hello Guys, I'm receiving errors in my application on a fairly regular basis now and I'm not sure how to begin solving it. Please find attached a backtrace for the error. It seems that its struggling to connect to the MySQL server, however I get this after the application has been running and querying the database for some time. Any ideas what might be causing this? I'd appreciate your thoughts. The code which throws the error is a very simple query(some_object).get(id) Cheers all, Heston database error.txt 2KViewDownload --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] cloning tables from object model
greetings, in my app i'm processing rows in a mysql table and i've trying to use SA in ORM-like manner and got stuck at something presumably totally simple. i have a class Orders and mapped the oder_table to Order and now i'm processing each row in order_table. one column in the table is order_quantity and if quantity 1, i need to take create a temp table with num rows = quantity and change the unique id modifier. easy in bare sql; many ways to do it. in trying to better understand SA, i've been trying to generate the temp_order_table from the already existing object model, Orders ... and totally failed. i got as far as order_schema = (order_table.select().execute()).fetchone() and my table structure by row.order_schema() but got stuck in the next step to get SA to create the temp_table. is there a OO best practice of doing this? how? thx, bb --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---