I'm trying to use Django to create unit test cases.(I use PyMySQL==0.9.3) When I run
python manage.py test -k Then I got an exception: Got an error creating the test database: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE DATABASE IF NOT EXISTS `test_t` ;\n SET sql_no' at line 2") I found Django use this code to avoid "database exists" warning: (django/backends/mysql/creation.py) if keepdb: # If the database should be kept, add "IF NOT EXISTS" to avoid # "database exists" error, also temporarily disable "database # exists" warning. cursor.execute(''' SET @_tmp_sql_notes := @@sql_notes, sql_notes = 0; CREATE DATABASE IF NOT EXISTS %(dbname)s %(suffix)s; SET sql_notes = @_tmp_sql_notes; ''' % parameters) PyMySQL doesn't support those SQL,but when I use mysqlclient, it works well.What should I do? -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/400012ad-d0ae-4da9-a787-094e8530075d%40googlegroups.com.