Ken*_*Ken 5 mysql linux django docker
我正在尝试 dockerise 我的 Django 应用程序。
docker-compose.yml
version: "3.8"
services:
db:
image: mysql:8
command: --default-authentication-plugin=mysql_native_password # this is not working
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootmypass
ports:
- '3306:3306'
cache:
image: redis
environment:
REDIS_HOST: localhost
REDIS_PORT: 6379
ports:
- '6379:6379'
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
- cache
Run Code Online (Sandbox Code Playgroud)
当我运行时docker-compose -up,出现以下错误。
django.db.utils.OperationalError: (1156, 'Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/mariadb19/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory')
Run Code Online (Sandbox Code Playgroud)
经过搜索,我发现解决方案是使用command: --default-authentication-plugin=mysql_native_password或降级mysql。尝试了第一个命令,但它不起作用。我也不想降级。
我如何让它工作?
额外细节:
| 归档时间: |
|
| 查看次数: |
4240 次 |
| 最近记录: |