MAMP Auto Start Servers

I have been having difficulty trying to get MySQL on the MAMP Stack v5.6.30 to auto start. I can get Apache to autostart. Sometimes MySQL will start, then stop, and cycle thru, but it never stays started.

Has anyone else experienced this? Can anyone share a successful method of getting MySQL to auto start? Alternatively, is there a way to simply auto start all MAMP servers at once?

I have been using plist files to accomplish this. I am using Mac OS X 10.11.6. Thanks!

Hi,

You say you used .plist files for autostarting the processes. Could you share your files so we can check what is going wrong? Furthermore, are you able to see which error the service throws when using launchctl?

Best regards,

Javier J. Salmerón

Sure, contents of mysql plist below:

"<?xml version="1.0" encoding="UTF-8"?>

Label com.bitnami.mysql.services ProgramArguments //Applications/mamp/mysql/bin/mysqld_safe --defaults-file=/Applications/mamp/mysql/my.cnf --port=3306 --socket=/Applications/mamp/mysql/tmp/mysql.sock --datadir=/Applications/mamp/mysql/data --log-error=/Applications/mamp/mysql/data/mysqld.log --pid-file=/Applications/mamp/mysql/data/${machine_hostname}.pid UserName asi_adminPreformatted text RunAtLoad
<key>OnDemand</key>
<false/>
"

Hi @JustAnotherITGuy,

It seems your file differs from the one pointed out on our guide. Did you follow our guide for making components auto-start on OS X? https://docs.bitnami.com/installer/faq/osx-faq/#how-to-start-the-stack-automatically-on-boot

For some reason my plist did not copy thru completely, that is why it looked different. I deleted it and created a new one based on the link you provided but no change. MySql will not start automatically.

<?xml version="1.0" encoding="UTF-8"?> Label ctlscript-mysql ProgramArguments Applications/Mamp/mysql/bin/mysqld_safe --defaults-file=Applications/Mamp/mysql/my.cnf --port=3306 --socket=Applications/Mamp/mysql/tmp/mysql.sock --datadir=Applications/Mamp/mysql/data --log-error=Applications/Mamp/mysql/data/mysqld.log --pid-file=Applications/Mamp/mysql/data/${machine_hostname}.pid RunAtLoad UserName _mysql GroupName _mysql

Hi,

Just wanted to let you know that we reproduced this issue and are looking into it. We’ll get back to you when we have more information.

Best regards,
Marcos

Hi @JustAnotherITGuy,

We have been looking into this issue and have found a plist that works for us. Could you try to apply it?

Before doing anything, please do launchctl unload -w to the plist files you added. After that, create the following .plist files and load them with launchctl load -w:

File: /Library/LaunchDaemons/com.bitnami-mamp.apache.service.plist

<?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.apache</string>
        <key>ProgramArguments</key>
        <array>
            <string>INSTALLDIR/apache2/bin/httpd</string>
            <string>-f</string>
            <string>INSTALLDIR/apache2/conf/httpd.conf</string>
            <string>-DFOREGROUND</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>UserName</key>
        <string>USERNAME</string>
    </dict>
</plist>

File: /Library/LaunchDaemons/com.bitnami-mamp.mysql.service.plist

<?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.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>

NOTE: Don’t forget to replace all INSTALLDIR and USERNAME placeholders.

I hope it works!

Hello,

So the new plist you shared for mysql worked! But, the new plist you shared for apache does not. However, I was able to use the previous plist file to start apache and that still works.

Hi,

We are glad that you were able to fix the issue.

If you have any other question and you think we can help, please don’t hesitate to ask.

Best regards,
Silvio Fernández

Hello. So, I am upgrading MAMP 7.1.x installs to later versions, which now uses mariadb, not mysql. I modified the plist to remove mysql and replace with mariadb, but that doesn’t seem enough to auto start mariadb service. Has anyone else ran into this issue? What is the proper syntax in the plist to auto start mariadb with MAMP 7.4.x?

Hello @JustAnotherITGuy,

Could you please open a new case with all the information? Note this case is over 5 years old.

Regards