Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL crashing on startup #273

Open
oleonard opened this issue Mar 27, 2024 · 3 comments
Open

MySQL crashing on startup #273

oleonard opened this issue Mar 27, 2024 · 3 comments
Assignees

Comments

@oleonard
Copy link

oleonard commented Mar 27, 2024

When starting up the container ('docker-compose up') MySQL appears to crash with an error, and the startup process is caught up in a loop as it tries again and again. Attached is the output of what I believe to be the whole "cycle."

which Branch / PHP Version are you using ?
php74

Desktop (please complete the following information):

@Azaciux
Copy link

Azaciux commented May 7, 2024

Think this is due to MYSQL update?

Edited: ./bin/mysql8/Dockerfile

Comment the following:

FROM mysql:8
RUN echo "[mysqld]" >> /etc/mysql/my.cnf
#RUN echo "default-authentication-plugin=mysql_native_password" >> /etc/mysql/my.cnf

Edit docker-compose file, and enter the following:

    volumes:
      - ${MYSQL_INITDB_DIR-./config/initdb}:/docker-entrypoint-initdb.d
      - ${MYSQL_DATA_DIR-./data/mysql}:/var/lib/mysql
      - ${MYSQL_LOG_DIR-./logs/mysql}:/var/log/mysql
    command: --mysql-native-password=ON

After doing the above I can now boot up the MYSQL instance without it going into a restart loop. (After rebuilding with docker compose up --build)

@mhcifci
Copy link

mhcifci commented May 26, 2024

Think this is due to MYSQL update?

Edited: ./bin/mysql8/Dockerfile

Comment the following:

FROM mysql:8
RUN echo "[mysqld]" >> /etc/mysql/my.cnf
#RUN echo "default-authentication-plugin=mysql_native_password" >> /etc/mysql/my.cnf

Edit docker-compose file, and enter the following:

    volumes:
      - ${MYSQL_INITDB_DIR-./config/initdb}:/docker-entrypoint-initdb.d
      - ${MYSQL_DATA_DIR-./data/mysql}:/var/lib/mysql
      - ${MYSQL_LOG_DIR-./logs/mysql}:/var/log/mysql
    command: --mysql-native-password=ON

After doing the above I can now boot up the MYSQL instance without it going into a restart loop. (After rebuilding with docker compose up --build)

I have tried this, but I keep getting the following errors.

2024-05-26 14:55:55 2024-05-26T11:55:55.345551Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2024-05-26 14:55:55 2024-05-26T11:55:55.345622Z 0 [ERROR] [MY-010952] [Server] The privilege system failed to initialize correctly. For complete instructions on how to upgrade MySQL to a new version please see the 'Upgrading MySQL' section from the MySQL manual.
2024-05-26 14:55:55 2024-05-26T11:55:55.345708Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-05-26 14:55:56 2024-05-26T11:55:56.876894Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.0)  MySQL Community Server - GPL.
2024-05-26 14:55:56 2024-05-26T11:55:56.876925Z 0 [System] [MY-015016] [Server] MySQL Server - end.

Operation System: Win11

@mhcifci
Copy link

mhcifci commented May 26, 2024

Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

I solved this problem by cleaning the "data" folder.

Then I rebuilt with docker-compose -d --build, it opened no problem thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants