I’m doing some work with the SQL server included with the MAMP package. I’d like to set up my computer so that the SQL server launches automatically whenever I boot up. Does anyone know the simplest way to make this happen?
Many, many thanks,
D.
UPDATE
When I try using the LaunchDaemon file suggested by Macmade, below, I get the following errors:
110906 19:52:05 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql
110906 19:52:05 [Warning] Setting lower_case_table_names=2 because file system for /Applications/MAMP/db/mysql/ is case in$
110906 19:52:05 [Note] Plugin 'FEDERATED' is disabled.
^G/Applications/MAMP/Library/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110906 19:52:05 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110906 19:52:05 InnoDB: The InnoDB memory heap is disabled
110906 19:52:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110906 19:52:05 InnoDB: Compressed tables use zlib 1.2.3
110906 19:52:05 InnoDB: Initializing buffer pool, size = 128.0M
110906 19:52:05 InnoDB: Completed initialization of buffer pool
110906 19:52:05 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
110906 19:52:05 mysqld_safe mysqld from pid file /Applications/MAMP/db/mysql/Doyuen-Kos-Mac-Pro.local.pid ended
After this didn’t work, I looked in some of MAMPs directories and found a script called startMysql.sh. When I run this from the command line, it starts the sql server. Perfect. On the off chance it might work, I tried throwing this into a LaunchDaemon file, too.
<?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>KeepAlive</key>
<false/>
<key>Label</key>
<string>mysql</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/MAMP/bin/start.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
This didn’t work either. Also, strangely, it didn’t seem to produce any message of any sort in the Console app.
I’m still stuck. Anyone have any ideas?
I just figured out one possible solution to this problem. It turns out that the paid version of MAMP, MAMP Pro, has a simple 1-click feature to configure your system to launch the SQL server on startup. So, shelling out ~$50 USD to buy the paid version is one way to get this working. It’s not the kind of solution I was hoping for, but it got the job done.