MySQL始终保持活力。 I use docker desktop in Windows 10
Logs
2024-05-14 02:31:01+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2024-05-14 02:31:02+00:00 [Note] [Entrypoint]: Switching to dedicated user mysql
2024-05-14 02:31:02+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
2024-05-14 02:31:02+00:00 [Note] [Entrypoint]: Initializing database files
2024-05-14T02:31:02.917093Z 0 [Warning] [MY-011068] [Server] The syntax --skip-host-cache is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2024-05-14T02:31:02.917272Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.30) initializing of server in progress as process 80
2024-05-14T02:31:02.919694Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2024-05-14T02:31:02.919703Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
2024-05-14T02:31:02.919794Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-05-14T02:31:02.919991Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.30) MySQL Community Server - GPL.
docker-compose.yml
db:
container_name: db-klv
image: mysql:8.0.30
restart: always
volumes:
- .db-data:/var/lib/mysql
- ./docker/mysql-config/my.cnf:/etc/mysql/my.cnf
- .db-data-priv:/var/lib/mysql-priv
- ./docker/mysql-init-scripts/init-user-db.sql:/docker-entrypoint-initdb.d/init-user-db.sql
environment:
MYSQL_DATABASE: root
MYSQL_ROOT_PASSWORD: Std@12345678
MYSQL_USER: UKlv
MYSQL_PASSWORD: UKlv@2024
networks:
- klv-net
我试图拆除集装箱,去除形象,但不是工作。