check last executed query mysql

You can controll this option at run time.

If you prefer to output to a table:

Execute SET GLOBAL log_output = 'TABLE';
Execute SET GLOBAL general_log = 'ON';
Take a look at the table mysql.general_log

If you prefer to output to a file instead of a table:

SET GLOBAL log_output = "FILE"; the default.
SET GLOBAL general_log_file = "/path/to/your/logfile.log";
SET GLOBAL general_log = 'ON';

magento setup upgrade Unexpected error. Unable to create oAuth consumer account.

I have encountered this issue while community to enterprise migration and it was happening since the base table ‘oauth_consumer‘ was not available.

CREATE TABLE oauth_consumer (   entity_id int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Created At',
updated_at timestamp NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP COMMENT 'Updated At',
name varchar(255) NOT NULL COMMENT 'Name of consumer',
key varchar(32) NOT NULL COMMENT 'Key code',
secret varchar(32) NOT NULL COMMENT 'Secret code',
callback_url text COMMENT 'Callback URL',
rejected_callback_url text NOT NULL COMMENT 'Rejected callback URL',
PRIMARY KEY (entity_id),
UNIQUE KEY OAUTH_CONSUMER_KEY (key),
UNIQUE KEY OAUTH_CONSUMER_SECRET (secret),
KEY OAUTH_CONSUMER_CREATED_AT (created_at),
KEY OAUTH_CONSUMER_UPDATED_AT (updated_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='OAuth Consumers';