"Enable MySQL VideoDB" and Synology

Hy,

I’m trying to configure two RPi 2 and one NAS

I’have see in “My OSMC” / “NetWork” a new field… “MySQL”, Great new ^^

After a backup… I have create a new user under my phpmyadmin with these parameters

CREATE USER 'osmc' IDENTIFIED BY 'osmc';
GRANT ALL ON `MyVideos%`.* TO 'osmc';
GRANT ALL ON `MyMusic%`.* TO 'osmc';
FLUSH PRIVILEGES;

and under my osmc, I have put these parameters

Enable MySQL VideoDB

Name : MyVideos <--------------------- Be careful, this field is empty
IP Address : My NAS
Port : My SQL port as 3306
User : osmc
Pass : osmc
Import Watched State : No <----------------- Can’t turn ON
Import Resume Points : No <----------------- Can’t turn ON

and when I restart my Rpi, sections “Films” and “TV Series” are missing…

PS : The Database MyVideos93 have been automatically create on my Synology, but empty…

Why ?

A small step forward …

If I reactive “Categories”, the database fills on the NAS but I lost all informations about the films/TV Shows seen or not seen …

How to preserve these informations ?

I have tried to add in my advancedsettings.xml

<advancedsettings>
  <videolibrary>
    <importwatchedstate>true</importwatchedstate>
    <importresumepoint>true</importresumepoint>
  </videolibrary>
</advancedsettings>

but same issue :frowning:

This works
http://kodi.wiki/view/MySQL

I know this Wiki…

you managed to use a common database and two Rpi2 under OSMC?

Yes,

I have my SQL DB on a NAS, and a couple of Rpi2s in the house that both access it.

The media source must be exactly the same for both devices.
This is my advancedsettings.xml on both.

<advancedsettings>
<videodatabase>
	<type>mysql</type>
	<host>192.168.1.10</host>
	<port>3306</port>
	<user>xbmc</user>
	<pass>xbmc</pass>
</videodatabase>
<musicdatabase>
	<type>mysql</type>
	<host>192.168.1.10</host>
	<port>3306</port>
	<user>xbmc</user>
	<pass>xbmc</pass>
</musicdatabase>
<videolibrary>
	<importwatchedstate>true</importwatchedstate>
	<importresumepoint>true</importresumepoint>
</videolibrary>
</advancedsettings>

missing the close tag?
</advancedsettings>

1 Like

It’s OK for me but when I switch on central database, I miss all my informations regarding films see or not see, TV Show see or not see… How keep theses informations ?

@marengaz : yes :wink:

Have you given the correction permissions to the to the mysql account so that it can write to the database?

It might be easier to start from scratch and follow the Wiki guide to the letter.

Start with 1 db and 1 rpi, once that works then you can add the second rpi.

You need to export your local databases then import them to the MySql database to retain watched states, see the Kodi wiki

no, just add

 <videolibrary>
 	<importwatchedstate>true</importwatchedstate>
 	<importresumepoint>true</importresumepoint>
 </videolibrary>

:wink:

I have resolved my issue

1 - Make a backup with OSMC tool
2 - Create an user with phpMyAdmin on the Synology

CREATE USER 'osmc' IDENTIFIED BY 'osmc';
GRANT ALL ON `MyVideos%`.* TO 'osmc';
GRANT ALL ON `MyMusic%`.* TO 'osmc';
FLUSH PRIVILEGES;

3 - Import backup on the second Rpi with OSMC tool
4 - Change advancedsettings.xml manually on both Rpi and restart (OSMC tool don’t work actually)

 <advancedsettings>
 <videodatabase>
 	<type>mysql</type>
 	<host>192.168.1.10</host>
 	<port>3306</port>
 	<user>osmc</user>
 	<pass>osmc</pass>
 </videodatabase>
 <musicdatabase>
 	<type>mysql</type>
 	<host>192.168.1.10</host>
 	<port>3306</port>
 	<user>osmc</user>
 	<pass>osmc</pass>
 </musicdatabase>
 <videolibrary>
 	<importwatchedstate>true</importwatchedstate>
 	<importresumepoint>true</importresumepoint>
 </videolibrary>
 </advancedsettings>

5 - Enable categories for each directory

Thanks to everyone :wink: