Configure Sockso 1.1.1 Personal Media Server to use MySQL

socksologoSockso is a free, open-source, personal music server. It’s designed to be as simple as possible so that anyone with a mouse and some mp3’s can get their friends listening to their music across the internet or intranet in seconds! Having tested the latest version 1.1.1, I have found that this application to be quite efficent and useful in it’s default configuration. However, if you should try to venture out to a more advanced configuration, you may most likely run into problems that are easily resolvable.

Sockso is as easy to setup as indicated in the statement above, mainly as described by the creators of Sockso. This is an OS independent installation and if there is any issue with the default setup of this application the online manual and FAQs are quite helpful. However, if you should try to venture out to a more advanced configuration, you may most likely run into problems that are easily resolvable.

sockso

A configuration option that is available to is bypass the built database and upgrade to a more advanced one, such as MySQL, among the other options. The modifications are detailed well on the Sockso website, however, the installation fails at the final step where Sockso is to create the tables for the database that was manually created. Sockso is known not to create these tables, as in my case and the testiment of many users as found in the Sockso FAQs. In one of the FAQs, a template is introduced (with an error, that some may not be able to work around) that can be used to import into the manually created Sockso MySQL database. I have successfully imported the following template into my database and Sockso works as advertised.

Here is that import.

-- phpMyAdmin SQL Dump
-- version 2.10.3
-- http://www.phpmyadmin.net
-- 
-- Host: localhost
-- Generation Time: Nov 16, 2008 at 02:34 PM
-- Server version: 5.0.51
-- PHP Version: 5.2.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

-- 
-- Database: `sockso`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `albums`
-- 

DROP TABLE IF EXISTS `albums`;
CREATE TABLE IF NOT EXISTS `albums` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `artist_id` int(10) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `date_added` datetime NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `artist_id` (`artist_id`,`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `artists`
-- 

DROP TABLE IF EXISTS `artists`;
CREATE TABLE IF NOT EXISTS `artists` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `date_added` datetime NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `collection`
-- 

DROP TABLE IF EXISTS `collection`;
CREATE TABLE IF NOT EXISTS `collection` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `path` varchar(500) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `playlists`
-- 

DROP TABLE IF EXISTS `playlists`;
CREATE TABLE IF NOT EXISTS `playlists` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `date_created` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  `user_id` int(10) unsigned default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `playlist_tracks`
-- 

DROP TABLE IF EXISTS `playlist_tracks`;
CREATE TABLE IF NOT EXISTS `playlist_tracks` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `playlist_id` int(10) unsigned default NULL,
  `track_id` int(10) unsigned default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `play_log`
-- 

DROP TABLE IF EXISTS `play_log`;
CREATE TABLE IF NOT EXISTS `play_log` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `track_id` int(10) unsigned default NULL,
  `date_played` datetime NOT NULL,
  `user_id` int(10) unsigned default NULL,
  `scrobbled` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `ix_play_log_track_id` (`track_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `properties`
-- 

DROP TABLE IF EXISTS `properties`;
CREATE TABLE IF NOT EXISTS `properties` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(100) NOT NULL,
  `value` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `request_log`
-- 

DROP TABLE IF EXISTS `request_log`;
CREATE TABLE IF NOT EXISTS `request_log` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `user_id` int(10) unsigned default NULL,
  `ip_address` char(16) NOT NULL,
  `date_of_request` datetime NOT NULL,
  `request_url` varchar(255) NOT NULL,
  `user_agent` varchar(255) NOT NULL,
  `referer` varchar(255) NOT NULL,
  `cookies` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `sessions`
-- 

DROP TABLE IF EXISTS `sessions`;
CREATE TABLE IF NOT EXISTS `sessions` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `code` char(10) NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `date_created` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `tracks`
-- 

DROP TABLE IF EXISTS `tracks`;
CREATE TABLE IF NOT EXISTS `tracks` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `artist_id` int(10) unsigned NOT NULL,
  `album_id` int(10) unsigned default NULL,
  `name` varchar(255) NOT NULL,
  `path` varchar(500) NOT NULL,
  `length` int(10) unsigned NOT NULL,
  `date_added` datetime NOT NULL,
  `collection_id` int(10) unsigned NOT NULL,
  `track_no` smallint(6) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `artist_id` (`artist_id`,`album_id`,`name`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

-- --------------------------------------------------------

-- 
-- Table structure for table `users`
-- 

DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `name` varchar(50) NOT NULL,
  `pass` char(32) NOT NULL,
  `email` varchar(255) NOT NULL,
  `date_created` datetime NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AU