Doubt about the behavior of lc_time_names in MySQL

1

The MySQL documentation indicates that to control the language in which the names of days and months are presented, as well as their abbreviations, lc_time_names must be used.

So to establish this configuration in Spanish I do for example:

SET lc_time_names = 'es_ES';

However, I do not read anything in the documentation about what scope that query has , that is, if it is effective only for that context in which I execute it or if it establishes some kind of definitive configuration in the database handler until it is changed again for something else.

What would then be the scope of SET lc_time_names ?

    
asked by A. Cedano 08.01.2018 в 12:43
source

1 answer

2

By using SET to modify system variables, you can get what:

  • The modification is permanent using GLOBAL (or @@global. ), since it sets the value of the variable globally.

    SET GLOBAL lc_time_names = 'es_ES';
    SET @@global.lc_time_names = 'es_ES';
    
  • The modification is for the session ( "temporary" ), using SESSION (or @@session. o @@ ), since it sets the value of the variable only for session in course.

    SET SESSION lc_time_names = 'es_ES';
    SET @@session.lc_time_names = 'es_ES';
    SET @@lc_time_names = 'es_ES';
    

Notes:

  • LOCAL and @@local. are synonyms of SESSION and @@session.
  • If a modifier is not added, SET changes the variable for the session.
answered by 08.01.2018 / 16:28
source