mysql> CREATE DATABASE django_1; Query OK, 1 row affected (0.24 sec)
mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | django_1 | | mysql | | performance_schema | | test | +--------------------+ 5 rows in set (0.31 sec) mysql> exit Bye python manage.py syncdb Traceback (most recent call last): (...) File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue django.db.utils.OperationalError: (1046, 'No database selected') python manage.py syncdb django_1 CommandError: Command doesn't accept any arguments python manage.py syncdb --django_1 Usage: manage.py syncdb [options] Create the database tables for all apps in INSTALLED_APPS whose tables haven't already been created. manage.py: error: no such option: --django_1 <> Ok, so MySQL wanted a db name, even though there was no db name (at least not one I gave it) on sqlite3 when I ran syncdb without a name, it said no db selected When I tried pointing it to a name, I got 'doesn't accept arguments' and then 'no such option.' Is django now saying this new database has to be listed as an installed app? What am I missing here? - and thanks for much for your help. On Tue, Jan 28, 2014 at 8:45 PM, Ariel E. Isidro <ar...@asherama.com> wrote: > "Or can I create the database, (presumably directly in the shell), and > then empty it, as these instructions say, and that will take care of it? I > frankly didn't understand why I would need to 'empty' a new and empty > database, but that's what it says. " > > With sql lite, everything will be created for you. > While with MySQL, you should create the database directly in the shell, > and this should give you an empty database. The Django tables will be > created after configuring your settings, and running syncdb. > > > > > On Wed, Jan 29, 2014 at 1:17 AM, Malik Rumi <malik.a.r...@gmail.com>wrote: > >> This is somewhat like the question in "need help moving to production >> server" but I think the right procedure is to start a new thread. So I >> think I have done well for just starting out. With your help I've gotten >> Django running on Windows, and I completed a tutorial and got my site >> working locally with the admin. thank you. >> >> So I thought I was ready to move up to MySQL for some heavy lifting. I >> followed the instructions I got here >> http://matthewwittering.com/blog/how-to-migrating-the-database-engine-for-django.html. >> I did not know what to do with the NAME part, so I put in 'django-1', and >> promptly got the error message 'unknown database 'django-1'. I thought that >> made sense because I hadn't created this database in mysql already, but >> I was just blindly following along. Having to CREATE DATABASE doesn't make >> sense, I thought, because it defeats the purpose of Django abstraction in >> the first place. Besides, when I syncdb, it should take whatever name I >> gave it when I was using sqlite3, right? >> >> Wrong. When I ran syncdb, this time with NAME: ' ', I got : File >> "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in default >> terror handler raise errorclass, errorvalue >> django.db.utils.OperationalError: (1046, 'No database selected'). >> >> So, what am I missing here? There almost certainly is an easy solution >> I'm not seeing. Do I need to create a database in mysql? If so, must it >> have the same name as it had in sqlite3? I know that name was made from >> putting the model name together with something else, but I don't actually >> remember what it was, and it seems like a lot of extra work to install an >> sqlite browser just to get that name right. If that's what I need to do, >> maybe I can just open that file with notepad? >> >> Or can I create the database, (presumably directly in the shell), and >> then empty it, as these instructions say, and that will take care of it? I >> frankly didn't understand why I would need to 'empty' a new and empty >> database, but that's what it says. >> >> Any and all helpful advise welcome and appreciated. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/f4a6d446-7cf8-498a-8ba5-04e339dd80b9%40googlegroups.com >> . >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > *Ariel E. Isidro* > Backup your important files, click here <http://db.tt/7cLLR7V/> > > DISCLAIMER: This message is for the designated recipient only and may > contain confidential and/or privileged information. If you have received it > in error, please delete it and advise the sender immediately. You should > not copy or use it for any other purpose, nor disclose its contents to any > other person. > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Django users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/django-users/zpNqaA2Fji8/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAECOjiZL2Jx0M%2BYVdpX45TQDfQBGNgzMGGmOo6XiGb6JtwVkgQ%40mail.gmail.com > . > > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKd6oBz55Bf4xc13C8UHN%2B%3DiM%3DncMpfgzsYs3PRFUBRZDo5frQ%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.