Debugging a Running Server (on Linux)

You are viewing an old version of this article. View the current version here.

If your mysqld server hangs, you may want to debug it to know what happened.

Preferably the server should be compiled for debugging, but it's not strictly necessary:

cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_VALGRIND=ON .
make -j4

To know what the server is doing:

  • Find out the process number of mysqld
ps -edalf | grep mysqld
  • Attach to the process and get a back trace:
gdb -p 'pid of mysqld' path-to-mysqld
set height 0
set logging file /tmp/mysqld.log
set logging on
thread apply all backtrace full

After the above you have a full backtrace, including all local variables, in the mysqld.log file.

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.