Skip to content

Instantly share code, notes, and snippets.

@kleenkanteen
Last active June 6, 2024 06:20
Show Gist options
  • Save kleenkanteen/aa6b066ebb2857e4c0a6bc55be5bdae5 to your computer and use it in GitHub Desktop.
Save kleenkanteen/aa6b066ebb2857e4c0a6bc55be5bdae5 to your computer and use it in GitHub Desktop.
I did not try to run either MySQL or MailServer independently.
I just tried to run MySQL independently. I found out what line is causing issues, it is this part "--default-authentication-plugin=mysql_native_password". So this docker-compose.yml does not work:
```
  db:
    image: mysql:8
    restart: always
    command: --default-authentication-plugin=mysql_native_password --sql_mode="" --skip-name-resolve --tls-version=""
    environment:
      MYSQL_ROOT_PASSWORD: ${MASTER_MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: ${MASTER_MYSQL_DATABASE}
      MYSQL_USER: ${MASTER_MYSQL_USER}
      MYSQL_PASSWORD: ${MASTER_MYSQL_PASSWORD}
It gives me this error:
```
/workspaces/cron-job.org (master) $ docker compose up
WARN[0000] Found orphan containers ([cron-joborg-mysql-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
[+] Running 2/2
✔ Network cron-joborg_default Created 0.1s
✔ Container cron-joborg-db-1 Created 0.2s
Attaching to db-1
db-1 | 2024-06-06 03:57:28+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
db-1 | 2024-06-06 03:57:28+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db-1 | 2024-06-06 03:57:28+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.0-1.el9 started.
db-1 | 2024-06-06 03:57:28+00:00 [Note] [Entrypoint]: Initializing database files
db-1 | 2024-06-06T03:57:28.550651Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
db-1 | 2024-06-06T03:57:28.551801Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.4.0) initializing of server in progress as process 80
db-1 | 2024-06-06T03:57:28.572331Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
db-1 | 2024-06-06T03:57:29.694256Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
db-1 | 2024-06-06T03:57:35.532272Z 0 [Warning] [MY-013595] [Server] Failed to initialize TLS for channel: mysql_main. See below for the description of exact issue.
db-1 | 2024-06-06T03:57:35.532301Z 0 [Warning] [MY-010069] [Server] Failed to set up SSL because of the following SSL library error: TLS version is invalid
db-1 | 2024-06-06T03:57:35.688029Z 0 [ERROR] [MY-000067] [Server] unknown variable 'default-authentication-plugin=mysql_native_password'.
db-1 | 2024-06-06T03:57:35.688442Z 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.
db-1 | 2024-06-06T03:57:35.688460Z 0 [ERROR] [MY-010119] [Server] Aborting
db-1 | 2024-06-06T03:57:37.256251Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.
db-1 exited with code 0
```
I tried looking up the errors one by one but can't fix it. Spent an hour so far. I tried implementing this answer: https://stackoverflow.com/a/50130973/16345931
But with the container_id substuted in "docker exec -it CONTAINER_ID bash", I see the "password:" prompt until I type the second character, then back to command mode.
But this works just fine:
```
  db:
    image: mysql:8
    restart: always
    command: --sql_mode="" --skip-name-resolve --tls-version=""
    environment:
      MYSQL_ROOT_PASSWORD: ${MASTER_MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: ${MASTER_MYSQL_DATABASE}
      MYSQL_USER: ${MASTER_MYSQL_USER}
      MYSQL_PASSWORD: ${MASTER_MYSQL_PASSWORD}
```
Why Is that? Could you try running the docker compose file on a github codespace? Would appreciate the help, I've sunk too much time into this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment