MAMP Auto Start Servers

Nevermind, I was wrong, it does not remain started if I stop and start it manually. No PLIST file, I have to manually start the service and it works fine. PLIST file with false flag, starts and stops consistently, making it unusable. Remove false flag from PLIST, service does not start automatically.

Hi @JustAnotherITGuy,

I recommend starting Apache and MariaDB individually following the examples in the guide:

https://docs.bitnami.com/installer/faq/osx-faq/administration/autostart-osx/

Regards,
Michiel

Those docs are outdated Michiel. That does work, when it used to be MySQL, 7.3 and prior versions. But since the change to MariaDB, it no longer applies, it doesn’t work.

Hi @JustAnotherITGuy,

You need to make sure that the command and the parameters work manually, replacing installdir with the correct installation directory and mysql with mariadb if needed.

  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  <plist version="1.0">
      <dict>
          <key>Label</key>
          <string>com.bitnami-APPNAME.mysql</string>
          <key>ProgramArguments</key>
          <array>
              <string>INSTALLDIR/mysql/bin/mysqld_safe</string>
              <string>--defaults-file=INSTALLDIR/mysql/my.cnf</string>
              <string>--mysqld=mysqld.bin</string>
              <string>--socket=INSTALLDIR/mysql/tmp/mysql.sock</string>
              <string>--datadir=INSTALLDIR/mysql/data</string>
              <string>--log-error=INSTALLDIR/mysql/data/mysqld.log</string>
              <string>--pid-file=INSTALLDIR/mysql/data/mysqld.pid</string>
              <string>--lower-case-table-names=1</string>
          </array>
          <key>RunAtLoad</key>
          <true/>
          <key>UserName</key>
          <string>USERNAME</string>
      </dict>
  </plist>

Regards,
Michiel

Without proper documentation, I am not sure I could do that properly. I have tried replacing the installdir locations previously, but that did not work at all, example below:

<?xml version="1.0" encoding="UTF-8"?> Label com.bitnami-mamp.mariadb ProgramArguments /Applications/MAMP/mariadb/bin/mysqld_safe --defaults-file=/Applications/MAMP/mariadb/my.cnf --mysqld=mysqld.bin --socket=/Applications/MAMP/mariadb/tmp/mysql.sock --datadir=/Applications/MAMP/mariadb/data --log-error=/Applications/MAMP/mariadb/data/mysqld.log --pid-file=/Applications/MAMP/mariadb/data/mysqld.pid --lower-case-table-names=1 RunAtLoad UserName karl
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.bitnami-mamp.mariadb</string>
        <key>ProgramArguments</key>
        <array>
            <string>/Applications/MAMP/mariadb/bin/mysqld_safe</string>
            <string>--defaults-file=/Applications/MAMP/mariadb/my.cnf</string>
            <string>--mysqld=mysqld.bin</string>
            <string>--socket=/Applications/MAMP/mariadb/tmp/mysql.sock</string>
            <string>--datadir=/Applications/MAMP/mariadb/data</string>
            <string>--log-error=/Applications/MAMP/mariadb/data/mysqld.log</string>
            <string>--pid-file=/Applications/MAMP/mariadb/data/mysqld.pid</string>
            <string>--lower-case-table-names=1</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>UserName</key>
        <string>karl</string>
    </dict>
</plist>

Hi @JustAnotherITGuy,

Please ensure the username is correct and the paths you have are correct as well. I just created a plist file for MariaDB

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.bitnami-mamp.mariadb</string>
        <key>ProgramArguments</key>
        <array>
            <string>/Applications/mampstack-8.1.4-0/mariadb/bin/mysqld_safe</string>
            <string>--defaults-file=/Applications/mampstack-8.1.4-0/mariadb/my.cnf</string>
            <string>--mysqld=mysqld</string>
            <string>--socket=/Applications/mampstack-8.1.4-0/mariadb/tmp/mysql.sock</string>
            <string>--datadir=/Applications/mampstack-8.1.4-0/mariadb/data</string>
            <string>--log-error=/Applications/mampstack-8.1.4-0/mariadb/data/mysqld.log</string>
            <string>--pid-file=/Applications/mampstack-8.1.4-0/mariadb/data/mysqld.pid</string>
            <string>--lower-case-table-names=1</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>UserName</key>
        <string>jotamartos</string>
    </dict>                 
</plist>

and confirmed the process was properly started when checking the system’s log

2022-03-31 12:11:38.816878 (gui/502/com.bitnami-mamp.mariadb) <Notice>: internal event: WILL_SPAWN, code = 0
2022-03-31 12:11:38.816891 (gui/502/com.bitnami-mamp.mariadb) <Notice>: service state: spawn scheduled
2022-03-31 12:11:38.816893 (gui/502/com.bitnami-mamp.mariadb) <Notice>: service state: spawning
2022-03-31 12:11:38.817012 (gui/502/com.bitnami-mamp.mariadb) <Notice>: launching: speculative
2022-03-31 12:11:38.817899 (gui/502/com.bitnami-mamp.mariadb [44919]) <Notice>: xpcproxy spawned with pid 44919
2022-03-31 12:11:38.817916 (gui/502/com.bitnami-mamp.mariadb [44919]) <Notice>: internal event: SPAWNED, code = 0
2022-03-31 12:11:38.817919 (gui/502/com.bitnami-mamp.mariadb [44919]) <Notice>: service state: xpcproxy
2022-03-31 12:11:38.817979 (gui/502 [100006]) <Notice>: Bootstrap by launchctl[44918] for /Library/LaunchDaemons/com.bitnami-mamp.mariadb.service.plist succeeded (0: )
2022-03-31 12:11:38.818022 (gui/502/com.bitnami-mamp.mariadb [44919]) <Notice>: internal event: SOURCE_ATTACH, code = 0
2022-03-31 12:11:38.823843 (gui/502/com.bitnami-mamp.mariadb [44919]) <Notice>: service state: running
2022-03-31 12:11:38.823856 (gui/502/com.bitnami-mamp.mariadb [44919]) <Notice>: internal event: INIT, code = 0
2022-03-31 12:11:38.823860 (gui/502/com.bitnami-mamp.mariadb [44919]) <Notice>: Successfully spawned mysqld_safe[44919] because speculative

You can easily test it by stopping the server using the ctlscript.sh file and starting MariaDB using the launchctl load/unload commands. If you continue running into problems with this functionality, please find someone in your community who can help you configure the boot processes. We do not provide 1:1 support and we just confirmed the database can be started without problems.

Well, it looks like the PLIST you provided works! Thank you so much!