There are several reasons for failure. The solution this time is the solution when the following is done but it still fails.
--The latest Xcode command line tools are installed --Latest pip installed --Mysql installed --OpenSSL installed
I get the following error even though there is no problem above.
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/gcc' failed with exit status 1
In this case, you can install it by executing the installation by the following method.
LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient
via Can't install mysqlclient on MacOS · Issue #131 · PyMySQL/mysqlclient-python