Musicbrainz Mac



(Redirected from Database Installation/Mac OS X Panther)

Products > Database > Database setup > Database setup on Mac OS X Panther

  • 1Installing the MusicBrainz database on Mac OS X Panther
    • 1.1Steps:

Installing the MusicBrainzDatabase onto Mac OS X Panther is relatively straightforward but there are a couple of things to look out for, hence the following instructions. There is no existing setup required except a standard Panther install and the Apple Developer Tools.

MusicBrainz Picard. Python-based music tagging software with CD lookup and AcoustID to. Installing the MusicBrainz database on Mac OS X Panther Installing the MusicBrainzDatabase onto Mac OS X Panther is relatively straightforward but there are a couple of things to look out for, hence the following instructions. MusicBrainz Picard is a cross-platform (Linux/Mac OS X/Windows) application written in Python and is the official MusicBrainz tagger.It supports the majority of audio file formats, is capable of using audio fingerprints , performing CD lookups and disc ID submissions, and it has excellent Unicode support. The shortcut to remove listings is 'delete'. This key does not exist on Mac portables, causing you to hold down fn-backspace. It can be annoying if you've got a few stray files by an artist, and the matched clusters are under a slightly different spelling.

Steps:

  • Install Postgres
  • Install some Perl Modules - DBI and DBD::Pg
  • Download the mb_server module
  • Download the data
  • Run the import script
  • Access the data with a GUI

Install Postgres

There is a double-clickable Mac OS X Package installer version provided by Marc Liyanage available from http://www.entropy.ch/software/macosx/postgresql/ along with some instructions for completeing the setup, the relevant parts of which I'll reproduce below:

1. Download and install the packagepgsql-7.3.3.pkg.tar.gz (http://www2.entropy.ch/download/pgsql-7.3.3.pkg.tar.gz)

2. Create a new user in the Users System Prefs pane:

Name: PostgreSQL User

Short Name: postgres

Password: whatever you want

3. Open a terminal window and type in the following commands:

  • type sudo chown -R postgres /usr/local/pgsql/, enter administrator password when asked
  • type su - postgres, enter the password of the newly created postgres user when asked
  • type /usr/local/bin/initdb -D /usr/local/pgsql/data and wait for the operation to complete
  • type /usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l postgres.log start

4. Now you can create a test database with /usr/local/bin/createdb test

5. Use it with the built in command line interface by entering /usr/local/bin/psql test

Make a point of creating the test database at the end as you can use it to verify the installation of a Perl module later on.

(Note: Apparently if you change the postgres user id # to less than 500 in netinfo it stops it showing up in your login panel. I've not bothered myself.)

Also Marc mentions that you may need to alter some system configuration parameters to get it working. I didn't need to do this and think that they are only necessary for large databases. However check out his full instructions if you run into trouble.

Install Some Perl Database Modules

You need to install two Modules, DBI and DBD::Pg

The first one is easy:

If you don't know what you're doing answer 'no' to the first question it asks and it will set itself up with the appropriate defaults.

Last chaos servers. Note that according to Tim Bray (http://www.tbray.org/ongoing/When/200x/2003/10/25/Panther) cpan install DBI should work too but I haven't tried it that way myself.

Musicbrainz Tagger Mac

The second one (DBD::Pg) is trickier. The following instructions are lifted from http://www.visualdistortion.org/adium/technical.html#parser.pl

There are a few environmental variables that need to be set to allow the CPAN compile process to find the various libraries PostgreSQL installs. Set them using the following syntax if you are running Bash as your shell (which is the default under Panther):

Note that in the original instructions it said 'username' twice. I've changed one to 'database' as I think it is a typo. If you use the name of the test database that Marc Liyanage's intructions ask you to create (i.e. 'test') and username postgres with whatever password you chose then you should be fine.

Musicbrainz Mac

If you run the install now, you will probably see errors relating to ranlib or libpq.a. Just run the following command preemptively:

After running that, you can finally install DBD::Pg by entering:

Download the mb_server module

I can't beat the simple instructions found at http://musicbrainz.org/development/cvs.html, except to remind you that you only need the mb_server module in order to access the database.

Download the Data

Download the four data dumps from http://musicbrainz.org/products/server/download.html (four not counting the RDF dump, which you don't need)

Note that Safari can be set to automatically expand compressed files, you probably want to disable that before downloading these files as the import script will uncompress them itself.

Run the Installer

You can edit mb_server/cgi-bin/DBDefs.pm and set DSN, DB_NAME, DB_USER and DB_PASSWD to the values of your own choosing. It's not necessary though, but you can have a look to see what the values are (database name, username and password are musicbrainz_db, musicbrainz_user, and blank by default)

I'm not sure if this is obvious or not but mb*.tar.bz2 refers to all the data dumps you just downloaded. So to run this with the exact command shown above you would need to be in your home directory and have the mb_server directory and all the bz2 archives located there as well.

After you run it find something else to do while it churns away for an hour or so.

Musicbrainz mac

Access the data with a GUI

You can get started right away by using the command line interface psql (found in /usr/local/bin/psql which may not be in your path) but I'd recommend using DbVisualiser. It's not obvious from the website but there is a totally free and relatively uncrippled version of the software available to download despite giving every impression that you can only get a 14-day limited trial. You *will* have to supply an email though.

By default Marc Liyanage's package installs Postgres without enabling access from other machines. This is also the mechanism used to connect to the database with a GUI so you need to add -o -i to enable that option. The following lines start or restart the database server with it enabled. (warning: typing from memory, will check these later)

Once you've done that start DbVisualiser and from the menu choose Database -> Driver Manager.. and locate the JDBC driver that was installed along with Postgres. (It will be a file called postgres.jar in /usr/local/pgsql/share/java/) then go to Database -> Add Database Connection and fill in the blanks as follows:

I'd also recommend switching to the Properties tab (in the row of tabs at the bottom) and checking the box for Show only the Default Database or Schema as it removes a great deal of excess clutter.

Then hit Connect and you should be done.

Retrieved from 'http://wiki.musicbrainz.org/index.php?title=History:Database_Installation/Mac_OS_X_Panther&oldid=66553'