Changes to my.ini Not Persisting when using MySQL

I'm attempting to update some variables for my MySQL database server; I am running Maria version 10.3.12 on a Windows 10 64-bit laptop. I have attempted to update the my.ini file located here:

C:\Program Files\MariaDB 10.3\data\my.ini

I am adding the following lines to a rather simple my.ini


I have saved the changes to the my.ini; but when I restart the database server using mysqld restart at the command console, and then log back into the client, I expect to see my changes using SHOW VARIABLES LIKE 'max%' and what I end up seeing is the default value. The default value for max_allowed_packet is about 16M and for the other two it is 28800.

There are numerous articles that relate to this; having poured over them I am aware of how to use the SET command to update these from within the client. My goal though is to make a permanent change.

I have no doubt I have overlooked something; any feedback is appreciated.

- - Source


answered 1 week ago Derviş Kayımbaşıoğlu #1

You can identify path of the configuration file by looking into services:

  • Open services and find MariaDB Service instance
  • Right click and click on Properties
  • You should see something like "C:\path\to\exe" --defaults-file="c:\path-to-ini\my.ini"

then you can edit correct configuration file

answered 1 week ago Gedalya #2

I found the solution. After making the changes noted in my post I was attempting to restart MySQL daemon using the Windows Command line and the following command:

C:\Users\david>mysqld restart
2019-03-14 21:05:48 0 [Note] mysqld (mysqld 10.3.12-MariaDB) starting as process 8548 ...

The results can be seen below the command which is mysqld restart

MySQL being installed and run as a Service, clearly this was not the was to restart it; so I restarted it using the Services.msc:

  1. Typing Services.msc into the search bar
  2. Selecting Services
  3. In the Services app find MySQL
  4. Right clicking MySQL and selecting Restart

This caused the my.ini file to be reread.

comments powered by Disqus