How to get executed SQL-Queries from MySQL/MariaDB

I have a program, which queries a mysql database, but I wanted to know the
query it executes.

To activate the logging of the queries to a databasetable I found the hint here.

It is as simple as executing the following statements:

SET GLOBAL log_output='TABLE';
SET GLOBAL general_log='ON';

After this just query the databasetable general_log in the mysql database.

use mysql;
select * from general_log;