Debugging a MySQL Server with debugging by doing:  mysqld --help . If the  --debug  flag is listed with the options then you have debugging enabled.  mysqladmin ver  also lists the  mysqld  version as  mysql ... --debug  in this case. If  mysqld  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 the CMAKE_C_FLAGS  and  CMAKE_CXX_FLAGS  CMake options and not use  -DWITH_DEBUG=1 . If  mysqld dies, you can at least attach to it with  gdb  or use  gdb  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 of  mysqld . If they find something “unexpected,”  an entry is written to  stderr , which  mysqld_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 at Section 1.6, “How to Report Bugs or Problems” . In the Windows MySQL distribution,  mysqld.exe  is by default compiled with support for trace files. If the  mysqld  server does not start or it crashes easily, you can try to create a trace file to find the problem. To do this, you must have a  mysqld  that has been compiled with debugging support. You can check this by executing  mysqld -V . If the version number ends with  -debug , it is compiled with support for trace files. (On Windows, the debugging server is named  mysqld-debug  rather than  mysqld .) Start the  mysqld  server with a trace log in  /tmp/mysqld.trace  on Unix or  \mysqld.trace  on Windows: On Windows, you should also use the  --standalone  flag to not start  mysqld  as a service. In a console window, use this command: After this, you can use the  mysql.exe  command-line tool in a second console window to reproduce the problem. You can stop the  mysqld  server with  mysqladmin shutdown . The trace file can become  very large ! To generate a smaller trace file, you can use debugging options something like this: This only prints information with the most interesting tags to the trace file. If you file a bug, please add only those lines from the trace file to the bug report that indicate where something seems to go wrong. If you cannot locate the wrong place, open a bug report and upload the whole trace file to the report, so that a MySQL developer can take a look at it. For instructions, see Section 1.6, “How to Report Bugs or Problems” . The trace file is made with the  DBUG  package by Fred Fish. See Section 5.9.4, “The DBUG Package” . Program Database files (with suffix  pdb ) are included in the  ZIP Archive Debug Binaries & Test Suite distribution of MySQL. These files provide information for debugging your MySQL installation in the event of a problem. This is a separate download from the standard MSI or Zip file. 1154 5.9.1.3 Using WER with PDB to create a Windows crashdump 5.9.1.2 Creating Trace Files shell>  mysqld --debug C:\>  mysqld-debug --debug --standalone mysqld --debug=d,info,error,query,general,where:O,/tmp/mysqld.trace