Reputation: 33
I am new to django. I need to use mysql database. I also need to specify the host, username, password..etc I tried to change my .settings file but it is not working
DATABASES = {
'default': {
'ENGINE': 'mysql',
'NAME': 'database',
'USER': 'root',
'PASSWORD': 'passwd',
'HOST': 'localhost',
'PORT': '',
}
}
Upvotes: 3
Views: 145
Reputation: 961
Its django.db.backends.mysql
not just mysql
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'database',
'USER': 'root',
'PASSWORD': 'passwd',
'HOST': 'localhost',
'PORT': '',
}
}
Upvotes: 4
Reputation: 4637
What you need to use is the backend module connection
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'yourdatabase',
'USER': 'yourusername',
'PASSWORD': 'yourpassword',
'HOST': 'localhost',
'PORT': '',
}
Upvotes: 0