get mysql database to log the queries to see what was requested

in my mysql instance, I have some databases running and I have some programs from which  I do not know which queries they use.

So I'd like to have a log with all queries.

The useful link is here.

log into your  database and activate the logging:

mysql> set global general_log=1;
mysql> set global log_output='table';

and
mysql> select * from mysql.general_log;

to show the entries.


use

mysql> set global general_log=0; 

to turn logging of.

If tried to delete entries from the table and dropped it, the table is not
available.

See here how to restore the table:

USE mysql;

CREATE TABLE IF NOT EXISTS `general_log` (
  `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `user_host` mediumtext NOT NULL,
  `thread_id` int(11) NOT NULL,
  `server_id` int(10) unsigned NOT NULL,
  `command_type` varchar(64) NOT NULL,
  `argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';
 to delete entries from the table use

truncate table mysql.general_log;