← Back to team overview

maria-developers team mailing list archive

Re: Regarding debugging MariaDB


Hi Sriram,

On 05/17/2014 10:00 AM, sriram patil wrote:
Hi Alexander,

I wanted to run mysqld in debug mode to check the trace file and get to
know workflow of SQL commands. I tried following command

mysqld --user=<username> --debug

Then, after connecting I executed some commands. But, the trace file is
not created in /tmp folder.

Is there anything I need to do while building the source code in order
for the debug mode to work?

Make sure that you compile a debug binary rather than
a release binary (which is default).

I usually compile and install like this:

cmake . -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/mariadb-10.0
make install

The "-DCMAKE_BUILD_TYPE=Debug" part is responsible to enable a debug build.

Note, you can check which version you're running by using this SQL query:


In case of a debug build it will be:

| version()             |
| 10.0.11-MariaDB-debug |

and in case of a release build it will be just:

| version()       |
| 10.0.10-MariaDB |

Note, before re-running cmake, it's usually a good idea to remove
its cache file like this:

rm CMakeCache.txt