Description: If your Django version is less than 1.8, the dbshell
command will not work with you have MySQL with SSL enabled. This module backports the functionality in Django 1.8 to previous versions.
- Django with version < 1.8
- MySQL database with SSL enabled
-
Install the application and its dependencies
pip install django-mysql-ssl
-
Make sure you have configured your mysql database in the django settings with the appropriate ssl ca. You may also need 'cert' and 'key', but for most purposes 'ca' should work fine. This functionality is built into django and has nothing to do with this plugin.
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', ... 'OPTIONS': {'ssl': {'ca': '<PATH TO CA CERT>'}} } }
-
Add 'mysql_ssl' to your INSTALLED_APPS:
INSTALLED_APPS += ('mysql_ssl',)
-
Connect to the db shell using the
dbshell_ssl
command:./manage.py dbshell_ssl
None
If you have questions, concerns, bug reports, etc, please file an issue in this repository's Issue Tracker.
Please feel free to fork this repo and submit Pull Requests with any enhancements.
- Django ticket explaining the broken dbshell command: https://code.djangoproject.com/ticket/22646
- Django PR implementing the functionality in Django 1.8: https://github.com/django/django/commit/01801edd3760f97a4ebc4d43ca5bbdbbdfebbb0a