1

I pretend to show a personalized message at login in MariaDB ver. 10.1.37 , in accordance with the data in one table.

My idea was to use a stored procedure as shown in fromdual.com but i can't find the my.cnf in my disk (I'm using Xampp), so i created the file and added SET GLOBAL init_connect="CALL audit.login_trigger()"; but now I have this error:

error: Found option without preceding group in config file: C:\xampp\mysql\my.cnf at line: 1 Fatal error in defaults handling. Program aborted

Q1)What preceding group should I type?
In this pdf from fromdual there is no details on this topic.

Q2) is there any other method?
I have look in to this question but I need to check the tables to create the message

This same question has been made in server fault, but I think that this site is more adequate.

  • You error is asking about C:\xampp\mysql\my.cnf so what is its contents? What exactly is MariaDB ver 15? 10.4 is still in beta so it hasn't reached 15 yet. – danblack Mar 12 at 4:16
  • Hi @danblack; 1st) I have corrected the version (I had that number on the top of my mind) my apologies. 2nd) the question in other words is - What is preceding group that should be in the my.cnf file before the SET GLOBAL init_connect="CALL audit.login_trigger()"; option? – Ezeq Mar 13 at 22:56
2

Your my.cnf file should have:

[mysqld]
init_connect="CALL audit.login_trigger()"

Or any other group name from running mysqld --help --verbose, there's a line like The following groups are read: mysqld server mysqld-10.1 mariadb mariadb-10.1 client-server galera, so any of those groups be can used instead of [mysqld].

SET GLOBAL ... is for setting mysqld system variables at runtime. The config file takes the shorter form.

  • thank you @danblack; Your help was most appreciated the init_connect now shows as the SP required. But it doesn't run as expected. I login with a normal user and did: 1) show global variables like 'init%'; - OK - 2) CALL mydb.warnings(); - OK - 3) quit - Login - no result back to 1) what i'm missing? – Ezeq Mar 15 at 22:54
  • 1
    Sounds like a new question that would involve showing the procedure contents and what results actually are. Probably would be the SECURITY [DEFINER|INVOKER] aspects of the procedure and who was the definer. – danblack Mar 15 at 23:54
  • Well the definition is DEFINER='root'@'localhost' I have made this question here. For future readers that use Xampp, I was able to do the sugested config in 'my.ini' accessible by it's control panel. – Ezeq Mar 16 at 13:35
  • 1
    Drawback: root (or any SUPER user) skips the init_connect command. – Rick James Mar 16 at 14:42
  • Thanks for the fast reply. Just did it, but the behavior is the same. The DEFINER='tk3'@'localhost' this user as a grant to select and call. It's the same one for the the login test. – Ezeq Mar 16 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.