How to add parameters to file my.cnf ?

Hello,

our partner would like to add parameters to my.cnf which will be these

[mysql]

[mysqld]

sql-mode = ""

how to do it correctly so it works even after reboot?

Thank you

Files: 
Status: 
Active

Comments

Howdy -- thanks for contacting us!

For those changes, you'd need to either use the Webmin file manager to browse to that file, and then you can edit it -- or, you can log in via SSH and use a text editor to make the changes.

The config file is typically located in "/etc/mysql/my.cnf" on Ubuntu systems.

After making that change, you'll then need to restart the MySQL service, which you can do with the command "service mysql restart".

Feel free to let us know if you have any additional questions!

Hello,

if i get it right, i only have to add these lines to my.cnf file, save it and reboot MYSQL service? Nothing else?

so the file will have these lines inside

#

The MySQL database server configuration file.

#

You can copy this to one of: - "/etc/mysql/my.cnf" to set global options, - "~/.my.cnf" to set user-specific options. One can use all long options that the program supports. Run program with --help to get a list of available options and with --print-defaults to see which it would actually understand and use.

#

For explanations see http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#

* IMPORTANT: Additional settings that can override those from this file! The files must end with '.cnf', otherwise they'll be ignored.

#

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

[mysql]

[mysqld]

sql-mode = ""

The my.cnf file should have an existing "mysqld" section in it... what you'd want to do is find that existing section, and then add your "sql-mode" within that section.

If it doesn't have a section named "mysqld", then you can add one, and then put your "sql-mode" within it just like you have above.

After that, restart MySQL and ou should be all set!

StatusFileSize
new548 bytes

I am sending attachment. Now it's clear and i would like to know how should i add these sections. Should i just edit file and type inside [mysql]

[mysqld]

sql-mode = ""

or is it harder to do this?

Thanks for any answer.

Yeah it should be as simple as what you're describing... and then just restart MySQL after you make those changes.

Studio A1 - Media Corp's picture
Submitted by Studio A1 - Med... on Wed, 02/06/2019 - 19:11

Eu estava tentando adicionar parametros ao meu my.cnf no sentido de tentar solucionar ERROR 2002 (Hy000) que não deixa Mysql Server conectar através do socket.Pois depois de tentar TUDO que tem na internet para solucionar, consegui através de simples desisntalação geral do Mysql e após nova instalação.O erro ainda persistia com a mesmo código de mensagem.Instalei MariaDB server e cliente. Pronto!!" Sem mexer em qualquer arquivo de configuração, apenas reinstall e install. Agora Mysql abre geral ---linha de comando, dentro do Webmin, Systemctl , Service.....tudo em paz agora... foram dias... Fica a dica!! Não corram muito atrás de erros de programa. Lembra do tempo que você foi um nubie de Windows? como era a coisa? Não deu certo instala e desinstala e volta a funcionar ou
reseta e loga de novo...voltou!!! Mentalidade de nubie win pra resolver grandes broncas linux.. dessa vez deu certo...