0

When I run mysql --verbose --help I get values that are different to those that are in my my.ini file. In particular, the following properties are set in my my.ini file (based on the recommendations in our company wiki) as follows:

max_allowed_packet=134217728
net_buffer_length=1000000 

but when I run mysql --verbose --help I get:

max-allowed-packet                16777216
net-buffer-length                 16384

I have checked the locations that the mysql command say it takes default options from:

C:\WINDOWS\my.ini 
C:\WINDOWS\my.cnf 
C:\my.ini 
C:\my.cnf 
C:\Program Files\MySQL\my.ini 
C:\Program Files\MySQL\my.cnf 
C:\opt\mysql-8.0.19-winx64\my.ini 
C:\opt\mysql-8.0.19-winx64\my.cnf

The only place where a file exists is C:\Program Files\MySQL\my.ini I have updated the settings there, but mysql --verbose --help still outputs the original values. What am I missing?

mal
  • 137
  • 6
  • In which section of the ini file do you have this setting? – Gerald Schneider Jun 04 '20 at 09:09
  • I wasn't aware there were sections, I just updated the first one in place, and appended the second one to the end of the file. – mal Jun 04 '20 at 09:15
  • OK I see it now. That's what I get for just searching the file instead of reading it. Care to write an answer that I can accept? – mal Jun 04 '20 at 09:16

1 Answers1

0

The mysql configuration file is ordered in sections. The various programs only read settings from their corresponding section.

The client reads the section [client], so you need to place your settings under it:

[client]
max_allowed_packet=134217728
net_buffer_length=1000000

See this excellent answer on SO for more information.

Gerald Schneider
  • 19,757
  • 8
  • 52
  • 79