title: In a MySQL Trigger, how to get informations on the user sending the request?
body: <p>I'm on MySQL 5.5, with a trigger, and I want to check if the user can do its request. It's just an exemple, how can I do with a code like this?</p>
  
  <pre><code>-- Trigger DDL Statements
  DELIMITER $$
  
  USE `database`$$
  
  CREATE TRIGGER TBI_TEST BEFORE INSERT
  ON tb_test FOR EACH ROW
  BEGIN
    DECLARE ER_BAD_USER CONDITION FOR SQLSTATE '45000';
  
    IF NEW.host != {{HOW TO KNOW THE HOST PART OF THE CURRENT USER?}} THEN
      SIGNAL ER_BAD_USER 
          SET MESSAGE_TEXT = 'forbidden', MYSQL_ERRNO = 401;
    END IF;
  END$$
  </code></pre>