I am new to MySQL, so this might be a dumb question, but I did not find the answer specifically after searching and searching here on SO.
All I'm trying to do is get the user id and only the user id of the caller of the insert or update in this table. I am not asking for help with a trigger in this matter, so don't worry about it.
SELECT user()
It gives: user@[IP Address]
SELECT current_user()
It gives: user@%
Minor problem: I only wantuser
My question is:
Am I going about it wrong?
Is there a cleaner or more readable way to get just userinstead of using something like substr(user(),1,instr(user(),'@')-1)? I wrote some triggers in Oracle where I could just use the value userfor what I need.
Thanks in advance