MySQL For Myth on Mac OS X

From MythTV Official Wiki
Revision as of 13:06, 13 April 2012 by Brianboonstra (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The MySQL database server is used by the backend to track your DVR configuration and the shows it has recorded. It can be run one of two ways

  • As a server process
  • As a slave process to a user login


If your DVR only has one user account can simply set that account to login automatically. If you have multiple user accounts, however, you may want to ensure the process does not depend on any particular user account being logged in.

This document details how to set the database server as a server process, which will run regardless of user logins.

Preference Pane

It is not necessary to install MySQL.prefPane. You can ignore all preference pane related instructions in the backend setup guide for OSX.


MySQL Server Startup Details

The MySQL distribution can set itself to start automatically on boot. You enable it if you install the MySQLStartupItem.pkg included in the MySQL distribution's disk image.

For the curious, all this package does is create a startup item /Library/StartupItems/MySQLCOM and set a value in /etc/hostconfig.

Server Control

After installation, the MySQL server needs to be started.

   sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

Simply rebooting will also cause the server to start.

If you want to stop the server while the machine is running (e.g. for a database upgrade), use the command

   sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop

Manually Running the Server

If you want to run the server from the command line, use the invocation sudo -u mysql /usr/local/bin/mysql/bin/mysqld.

Troubleshooting

MySQL Server Data Directory

If you get an error message such as Permission denied to the data directory, use this command:

sudo chmod -R oug+rwX directory

(where directory is typically /usr/local/mysql/data), then attempt to start the database server again.