(HTTP code 500) server error - Ports are not available: exposing port TCP 0.0.0.0:80 → 0.0.0.0:0: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
You will neeed to share more information. HTTP 500 is a serverside error code, meaning something actually responded. Unless the error code was returned by the API server of Docker.
Share what you exactly did to get this error message. What commands you ran for example.
Don’t forget to use code bblocks for shared commands and logs as described herE: How to format your forum posts
Note: The language of this forum is English. I ranslated the topic title using Google translate, but please, continue writing in English.
OK,thanks,this is my log:
2025-02-12 19:51:52+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.41-1.el9 started.
2025-02-12 19:51:52+08:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
2025-02-12 19:51:52+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.41-1.el9 started.
‘/var/lib/mysql/mysql.sock’ → ‘/var/run/mysqld/mysqld.sock’
2025-02-12 19:52:54+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.41-1.el9 started.
2025-02-12 19:52:54+08:00 [Note] [Entrypoint]: Switching to dedicated user ‘mysql’
2025-02-12 19:52:54+08:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.41-1.el9 started.
‘/var/lib/mysql/mysql.sock’ → ‘/var/run/mysqld/mysqld.sock’
2025-02-12T11:52:54.408422Z 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.
2025-02-12T11:52:54.409259Z 0 [Warning] [MY-010918] [Server] ‘default_authentication_plugin’ is deprecated and will be removed in a future release. Please use authentication_policy instead.
2025-02-12T11:52:54.409276Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.41) starting as process 1
2025-02-12T11:52:54.413543Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-02-12T11:52:54.452767Z 1 [ERROR] [MY-012526] [InnoDB] Upgrade is not supported after a crash or shutdown with innodb_fast_shutdown = 2. This redo log was created with MySQL 5.7.18, and it appears logically non empty. Please follow the instructions at http://dev.mysql.com/doc/refman/8.0/en/upgrading.html
2025-02-12T11:52:54.452807Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.
2025-02-12T11:52:54.923730Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2025-02-12T11:52:54.923906Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2025-02-12T11:52:54.923931Z 0 [ERROR] [MY-010119] [Server] Aborting
2025-02-12T11:52:54.924279Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.41) MySQL Community Server - GPL.
Please help me identify where the problem lies,thank you !
Just read the error message:
It seems there are some file from an old MySQL database and you run a new version, multiple major versions ahead. Either delete the files (if you don’t need the data) or run major versions (v6, v7) one after another in hope the data is migrated every time to the newer version. The provided link has probably more details.
I have uninstalled all the old MySQL files and cleaned up the registry. Pulling MySQL again still has the same error
This message clearly indicates it found some old files.
TL;DR;
Open an admin shell on Windows and then run
net stop winnat
net start winnat
This reset the reserved port but is a temporary solution, on next reboot the problem can raise again, for a permanent solution continue to read
Explanation
The problem is due to how Hyper-V work.
Hyper-V reserves some (large number!) random ports for its purpose, you can specify which ports can be reserved (ipv4 and ipv6) with commands below (admin mode)
netsh int ipv4 set dynamic tcp start=49152 num=16384
netsh int ipv6 set dynamic tcp start=49152 num=16384
Then reboot the machine and verify
netsh int ipv4 show dynamicport tcp
You can read more on this Here