MySQL Forums
Forum List  »  MySQL Workbench

Workbench is INSERTING two records into AUDIT table.
Posted by: KRM R
Date: July 15, 2013 04:57PM

Hello,

I am newbie for MySQL and Workbench. We recently started using MySQL database and I am a DBA for it. I created a logon trigger for auditing user access to MySQL. When a users logs in from Workbench, the audit trigger is inserting two rows into audit table and I can see two connections for the user under "SHOW PROCESSLIST". But if the same user logs in from a Linux command prompt, I can see only one active session and one record inserted into AUDIT table. Is there any settings that the user needs to change in the workbench? The audit trigger is pretty simple and straight forward.

DELIMITER //
drop PROCEDURE if exists admin.logon_trigger//
CREATE PROCEDURE logon_trigger()
BEGIN
declare cuser varchar(50);
select user() into cuser;
insert into admin.audit_info (login_time, user_host, session_id, db_name) values ( current_timestamp(), user(), connection_id(), database());
commit;
if cuser like 'abc%' then
SET time_zone = 'America/Chicago'; -- I just need to change timezone for a perticular user here.
end if;
END;
//

Thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
Workbench is INSERTING two records into AUDIT table.
1482
July 15, 2013 04:57PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.