Documentation Home
MySQL 8.4 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.2Mb
PDF (A4) - 40.3Mb
Man Pages (TGZ) - 262.0Kb
Man Pages (Zip) - 367.6Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


7.9.1.1 Compiling MySQL for Debugging

If you have some very specific problem, you can always try to debug MySQL. To do this you must configure MySQL with the-DWITH_DEBUG=1 option. You can check whether MySQL was compiled with debugging by doing:mysqld --help. If the--debug flag is listed with the options then you have debugging enabled.mysqladmin ver also lists themysqld version asmysql ... --debug in this case.

Ifmysqld stops crashing when you configure it with the-DWITH_DEBUG=1 CMake option, you probably have found a compiler bug or a timing bug within MySQL. In this case, you can try to add-g using theCMAKE_C_FLAGS andCMAKE_CXX_FLAGS CMake options and not use-DWITH_DEBUG=1. Ifmysqld dies, you can at least attach to it withgdb or usegdb on the core file to find out what happened.

When you configure MySQL for debugging you automatically enable a lot of extra safety check functions that monitor the health ofmysqld. If they find somethingunexpected, an entry is written tostderr, whichmysqld_safe directs to the error log! This also means that if you are having some unexpected problems with MySQL and are using a source distribution, the first thing you should do is to configure MySQL for debugging. If you believe that you have found a bug, please use the instructions atSection 1.6, “How to Report Bugs or Problems”.

In the Windows MySQL distribution,mysqld.exe is by default compiled with support for trace files.