我在我的 MySQL 服务器上进行了压缩,我想确保 Django 正在建立压缩连接。我该怎么做?
最佳答案
试验、错误和推断表明解决方案是在 OPTIONS
字典中使用一个设置为 True
的 compress
字段:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
...
'OPTIONS': {
'compress': True
}
}
}
虽然我无法确认连接是否真的被压缩了。
关于mysql - 如何在 Django 和 MySQL 之间使用压缩连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14909565/