This is an old revision of the document!


Using a shared Database

ComicRack 1.64 and up support putting your library into a shared SQL server. For now only the book information is stored in the SQL server. Smartlists and configurations are stored in the local user profile.

NOTE: This is an experimental and advanced feature and requires some knowledge on how to setup SQL servers.

Requirements

MySQL and Microsoft SQL servers are currently supported. All ComicRacks accessing the shared database MUST have the same (latest) version.

What is the advantage

ComicRack by default stores the database into a local file named 'ComicDb.xml'. This file is loaded when starting up, and regularly saved in the background when data changes. This means that it is possible to lose data when your system fails, as the saving is not done immediately after changes to the data occur. Also it is not possible to share this database with other users. Every user (on the same system or network) has to maintain his/her own database. Using a shared database solves all these problems. Users can share a library and changes get saved to the database immediately.

Setting up your SQL server

As always, before playing around: MAKE A BACKUP OF COMICDB.XML!

You need to create an empty database with full access rights on your server. Usually you would create a new user (let's say comicrack) and a new database on your server (let's say comicdb).

Mysql

For mysql, considering 192.168.100.3 the address where you have comicrack running, you could do the following to set up the database and user. Bold shows commands you have to type:

mysql -u root -p

Enter password:

(type the root user password for mysql)

mysql> CREATE DATABASE 'comicdb';

Query OK, 1 row affected (0.00 sec)

mysql> CREATE USER 'comicrack'@'192.168.100.3' IDENTIFIED BY 'PASSWORD';

Query OK, 0 rows affected (0.00 sec)

mysql> GRANT USAGE ON *.* to 'comicrack'@'192.168.100.3' IDENTIFIED BY 'PASSWORD';

Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON comicdb.* TO 'comicrack'@'192.168.100.3';

Query OK, 0 rows affected (0.00 sec)

mysql> exit

Bye

On comicrack.ini, you should then add:

DataSource=mysql:Server=192.168.100.5; Uid=comicrack; Pwd=PASSWORD; Database=comicdb;

where 192.168.100.5 is the address of the server running mysql.

Follow the the handbooks for your server type to accomplish this.

Telling ComicRack to use your new Database

If you use MySQL add the following line to your comicrack.ini file

DataSource=mysql:Server=your_server; Uid=your_user; Pwd=your_user_password; Database=your_database_name;

Should you use a Microsoft SQL server (this sample uses integrated security)

DataSource=mssql:Data Source=your_data_source; Initial Catalog=your_catalog_name; Integrated Security=True

The first time you start ComicRack with these new settings ComicRack will create the structure in the database, copy all your local entries to the database (this can take some time) and delete your local database.

MS SQL Server (By Bugmaniac)

Log in to SQL Management Studio as your 'sa' user.

Create a 'comicrack' logon.

Give that logon the following roles: dbcreator,public,securityadmin,serveradmin,sysadmin (Probably overkill but thats how I got it working)

Now log into management studio using the newly created 'comicrack' login.

Create a new database called 'comicdb' (Its up to you where to store the db files but I suggest you don't put them on your system disk)

Next up double click on the 'comicrack' login and select 'User Mapping'. make sure 'comicdb' is mapped (ticked) and has user 'comicrack' and Default Schema 'dbo'

Now edit the comicrack.ini file (Which in my case us here: “c:\Users\[YOUR_USER_NAME]\AppData\Roaming\cYo\ComicRack\”

Setup your data source as follows: (This example used SQLExpress but its the same for the full SQL Server)

DataSource=mssql:Server=SERVER\SQLEXPRESS;Database=comicDB;Uid=comicrack;Pwd=[COMICRACK_SQL_LOGIN_PASSWORD_HERE];

If your PC is called AWESOMENAMEFORAPC and your SQL Instance was installed as SQLROCKS then the string would look like this:

DataSource=mssql:Server=AWESOMENAMEFORAPC\SQLROCKS;Database=comicDB;Uid=comicrack;Pwd=[COMICRACK_SQL_LOGIN_PASSWORD_HERE];

Save and exit comicrack.ini

Now fireup Comic Rack and it will pause on teh loading screen while it connects to SQL and created the db content.

Once its done it will have imported all your info from the ComicDB.xml file into your nice ans shiny db!


Navigation