﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6312	manage.py dbshell and mysql problem on Windows	trung	nobody	"manage.py dbshell on windows is so strange. I am using mysql as my backend database.
After changing the client.py file in site-packages\django\db\backends\mysql it runs but I cannot do anything with it. It closes immediately when I type something.

client.py
--------------------------------------
from django.conf import settings
import os

def runshell():
    args = ['']
    db = settings.DATABASE_OPTIONS.get('db', settings.DATABASE_NAME)
    user = settings.DATABASE_OPTIONS.get('user', settings.DATABASE_USER)
    passwd = settings.DATABASE_OPTIONS.get('passwd', settings.DATABASE_PASSWORD)
    host = settings.DATABASE_OPTIONS.get('host', settings.DATABASE_HOST)
    port = settings.DATABASE_OPTIONS.get('port', settings.DATABASE_PORT)
    defaults_file = settings.DATABASE_OPTIONS.get('read_default_file')
    # Seems to be no good way to set sql_mode with CLI	
	
    if defaults_file:
        args += [""--defaults-file=%s"" % defaults_file]
    if user:
        args += [""-u %s"" % user]
    if passwd:
        args += [""-p %s"" % passwd]
    if host:
        args += [""-h %s"" % host]
    if port:
        args += [""--port=%s"" % port]
    if db:
        args += [db]
	
	del args[0]
    os.execvp('mysql', args)

"		closed	Uncategorized	dev		fixed	dbshell	0.97 pre	Unreviewed	0	0	0	0	0	0
