lando / mysql

The Official MySQL Lando Plugin
https://docs.lando.dev/mysql/
GNU General Public License v3.0
1 stars 2 forks source link

can not modify my_custom.cnf #21

Closed 0MAL closed 11 months ago

0MAL commented 1 year ago

I tried to change default engine from innodb to myisam, but it fails. What I tried to do was,

  1. opended file ./lando/config/mysql/my_custom.cnf
  2. add a line like this:default-storage-engine=MyISAM and default-table-type=myisam ;both didn't work.
  3. I restart myApp from Docker Desktop; this didn't work
  4. I restart mysql with the command: lando stop and the command:lando start ; this didn't work So I couldn't change default engine. And what is worse is, after "lando start" command, the file ./lando/config/mysql/my_custom.cnf was automatically reset to the initial data :[mysqld]max_allowed_packet=32M , and the command I added that is "default-storage-engine=MyISAM" was deleted automatically. That sucks.

What is the wrong? How can I change and apply my_custom.cnf?


lando v3.6.4 ,macosx catalina with intel chip, drupal10 recipe ;I coundn't install newer versions of lando so I installed v3.6.4 instead.

reynoldsalec commented 11 months ago

I think @0MAL you were on the right track; to make sure, the correct way to add config to a MySQL service is to designate the path to the config in your .lando.yml file. Example from the MySQL service docs:

services:
  myservice:
    type: mysql
    config:
      database: config/my-custom.cnf

If you're using the Drupal recipe and your config file was located in a directory called lando/config/mysql relative to the root of your project, you'd probably want to do something like this:

services:
  database:
    config:
      database: lando/config/database/my-custom.cnf

...since database is the name of the database service in the Drupal recipe.

FWIW I did check config loading on both the stock MySQL service and a Drupal recipe, seems like it's working as long as you define the path to the config.

Closing out since I'm guessing you've resolved this independently now, sorry for the late reply, hopefully helps future folks!