I attempted various solutions, but none were successful in resolving the issue.
Ultimately, I decided to uninstall MySQL using Homebrew with the command brew uninstall mysql. Afterward, I manually downloaded MySQL from the official MySQL portal, installed it, and it worked successfully.
Refer: https://www.geeksforgeeks.org/how-to-install-mysql-on-macos/