Configuración de variables globales para Mysql en Ubuntu 17

Configuración de variables globales para Mysql en Ubuntu 17

Estoy intentando configurar algunas variables globales y configurar la sesión para que un software de envío de correo para suscriptores funcione correctamente. Pero cuando intento configurar esas variables en my.cnfel archivo y reiniciar el mysqlservidor, aparece este error:

Job for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.

A continuación se muestra my.cnfel archivo

# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

mysql> SET GLOBAL sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

mysql> SET SESSION sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

Respuesta1

En primer lugar, parece que tienes algunos problemas al copiar y pegar. Es mysql>el mensaje del cliente de la consola, por lo que nunca debería estar en ningún archivo de configuración.

En segundo lugar, al configurar variables en elarchivo de configuración, simplemente se encuentran debajo de los [section]encabezados respectivos, uno por línea, y los valores clave están separados por un =signo igual.

Entonces, en /etc/mysql/mysql.conf.d/mysqld.cnfcualquier lugar debajo de [mysqld]agregar:

sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

información relacionada