Database management commands
I keep getting errors like this: _mysql_exceptions.OperationalError: (1005, "Can't create table 'arkestra_medic_dev.#sql-51b_4a8' (errno: 150)") when running database management commands (syncdb, south migrate). Sometimes those commands work, sometimes they don't; it happens across a variety of apps. I am working on a database that was exported from one system and has been imported into a new one. Running Django 1.3.1. I'm pretty sure the issue is something to do with my database/setup, rather than anything in the apps involved. Any suggestions greatly appreciated. Daniele -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Database management commands
On Thu, Oct 27, 2011 at 12:33 PM, Daniele Procida wrote: > I keep getting errors like this: > > _mysql_exceptions.OperationalError: (1005, "Can't create table > 'arkestra_medic_dev.#sql-51b_4a8' (errno: 150)") > > when running database management commands (syncdb, south migrate). > > Sometimes those commands work, sometimes they don't; it happens across a > variety of apps. > > I am working on a database that was exported from one system and has been > imported into a new one. > > Running Django 1.3.1. I'm pretty sure the issue is something to do with my > database/setup, rather than anything in the apps involved. > > Any suggestions greatly appreciated. > > Daniele > > errno 150 indicates that you tried to create an innodb table with an incorrectly formed foreign key constraint. http://dev.mysql.com/doc/refman/5.0/en/innodb-error-codes.html Are you trying to reference a myisam table from an innodb table, or are does the type of the column you are specifying as a foreign key not match the type of the primary key of the table you are referencing? Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Database management commands
On Thu, Oct 27, 2011, Tom Evans wrote: >On Thu, Oct 27, 2011 at 12:33 PM, Daniele Procida wrote: >> I keep getting errors like this: >> >> _mysql_exceptions.OperationalError: (1005, "Can't create table >'arkestra_medic_dev.#sql-51b_4a8' (errno: 150)") >> >> when running database management commands (syncdb, south migrate). >errno 150 indicates that you tried to create an innodb table with an >incorrectly formed foreign key constraint. > >http://dev.mysql.com/doc/refman/5.0/en/innodb-error-codes.html > >Are you trying to reference a myisam table from an innodb table, Not to my knowledge - certainly not deliberately! > or >are does the type of the column you are specifying as a foreign key >not match the type of the primary key of the table you are >referencing? That's possible. I can understand how the complicated migration history might cause this though, but not a simple syncdb of easy_thumbnails! Daniele -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Database management commands
This is a problem related to Innodb and MyISAM. Django uses this latter, while probably your imported DB is an Innodb one. Check here https://docs.djangoproject.com/en/dev/ref/databases/ Search Google for the matter too, you are not the only one experiencing it. I would suggest getting rid of the new tables you created, switching to InnoDB and migrating everything. Try and let me know. Leo 2011/10/27 Daniele Procida : > I keep getting errors like this: > > _mysql_exceptions.OperationalError: (1005, "Can't create table > 'arkestra_medic_dev.#sql-51b_4a8' (errno: 150)") > > when running database management commands (syncdb, south migrate). > > Sometimes those commands work, sometimes they don't; it happens across a > variety of apps. > > I am working on a database that was exported from one system and has been > imported into a new one. > > Running Django 1.3.1. I'm pretty sure the issue is something to do with my > database/setup, rather than anything in the apps involved. > > Any suggestions greatly appreciated. > > Daniele > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Database management commands
On Fri, Oct 28, 2011 at 12:49 AM, Leonardo Giordani wrote: > This is a problem related to Innodb and MyISAM. Django uses this > latter, Incorrect. Django doesn't have any built in preference for InnoDB or MyISAM -- it uses the system default table type. On most systems, MyISAM is the default, but this isn't guaranteed or expected. Django supports both MyISAM and InnoDB table types, but the available feature set changes depending on the underlying table store. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Database management commands
You are right, thanks. 2011/10/28 Russell Keith-Magee : > On Fri, Oct 28, 2011 at 12:49 AM, Leonardo Giordani > wrote: >> This is a problem related to Innodb and MyISAM. Django uses this >> latter, > > Incorrect. Django doesn't have any built in preference for InnoDB or > MyISAM -- it uses the system default table type. On most systems, > MyISAM is the default, but this isn't guaranteed or expected. > > Django supports both MyISAM and InnoDB table types, but the available > feature set changes depending on the underlying table store. > > Yours, > Russ Magee %-) > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Database management commands
On Fri, Oct 28, 2011, Russell Keith-Magee wrote: >On Fri, Oct 28, 2011 at 12:49 AM, Leonardo Giordani > wrote: >> This is a problem related to Innodb and MyISAM. Django uses this >> latter, > >Incorrect. Django doesn't have any built in preference for InnoDB or >MyISAM -- it uses the system default table type. On most systems, >MyISAM is the default, but this isn't guaranteed or expected. COuld it still be the case that the issue is the result of the older Django database having used one engine by default, and the new one the other? Daniele -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Database management commands
On Fri, Oct 28, 2011 at 2:35 AM, Daniele Procida wrote: > COuld it still be the case that the issue is the result of the older Django > database having used one engine by default, and the new one the other? > > That is possible -- in a MySQL shell, run "SHOW TABLE STATUS", and you can see the engine used by all of your tables. -- Regards, Ian Clelland -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.