Solved How to centralize KODI mySQL library with Synology MariaDB10
#1
How to centralize KODI mySQL library with Synology MariaDB10
 
I’m writing this ‘HowTo’ because it took me several hours to get this working and it should be done in 30 minutes. The reason is mainly because there isn’t a good howto and almost nothing about troubleshooting and the ones on the internet are mostly outdated. So, here’s my attempt.
If your experienced and in a hurry, I’ll tell you what solved it in my specific case,otherwise just read everything.
All my KODI devices logged the error: Unable to open database: MyVideos116 [2002](Can't connect to MySQL server on 'x.x.x.x' (115))

Solution: Although on a Synology DiskStation NAS the MariaDB-10 database is running on port 3307, you still have to make your KODI devices connect to port 3306! (instead of what some internet guides tell you.)
 
What’s the goal.
If you have a Synology DiskStation and multiple KODI devices it is very nice to centralize the KODI library in a Synology MariaDB database and they’ll all stay in sync.
Episodes you watched on one TV will show as “watched” on every KODI device. If you stop watching a movie in the living room, and resume watching in the bedroom, you can start right where you left off. Furthermore I noticed that KODI runs much faster since I’m using this setup.

Thus, Yeah, you want this!, here we go.
 
What you need.
  • Synology DiskStation running 6.2 and MariaDB 10.
  • KODI devices (in this case a Windows laptop and an Android 9 TVBOX, both with KODI 18.6)
  • Putty (download at www.putty.org )
  • Time (not for sale)
  • a bit of Linux and Windows knowledge.
 
Summery
In this scenario you have a LAN network 192.168.1.0/24 and all devices are in the same network.
If you have a different setup, change the IP addresses accordingly.
Here’s a short summary of what you need to do.
  • Synology DiskStation : install MariaDB10 and enable TCP/IP connection on port 3307.
  • Synology DiskStation : open port 3306 in the Synology firewall
  • Synology DiskStation : install phpadmin and configure kodi user
  • Synology DiskStation : enable SSH and configure MariaDB10 for Remote Client Access
  • KODI: Configure Kodi devices to use your new MariaDB Database server.
 
Synology Diskstation
  • MariaDB
Login to your Synology DiskStation and open the Package Centre and install MariaDB 10.
Open MariaDB10 from the Package Centre.
Enable the option : Enable TCP/IP connection on port 3307 and click Apply.
 
  • Phpadmin

Login to your Synology DiskStation and open the Package Centre.
Install phpadmin (if necessary)

 
  • Firewall
MariaDB runs on TCP port 3307 but your KODI client connect through port 3306 to this database, so in the Synology firewall you need to open port 3306 (not 3307!).
Login to your Synology DiskStation, open Control Panel - Security and select the Firewall.

Make sure your firewall is enabled.
In the Firewall profile section click ‘edit rules’
Change ‘All interfaces’ to ‘LAN’ via the pull down menu
Click the ‘create’ button (In this scenario the network is 192.168.1.0, please adjust to yours.)
  • PORT SECTION: Select custom Type = destination port, Protocol = TCP, Port = 3306 (not 3307)
  • SOURCE IP : Select Specific IP – IP Range : from 192.168.1.1 to 192.168.1.254 and click OK
  • ACTION : allow and click OK
Make sure the ‘3306’ rule is enabled and then click OK.
Your Synology firewall is now allowing 3306 network traffic from your LAN.
 
  • Enable SSH service
Login to your Synology DiskStation, open Control Panel – Terminal & SNMP
Enable the SSH service on port 22 and click the apply button.
(Don’t forget to disable this service again once you’re done !!)

 
  • Synology MariaDB – enable connections from the (LAN) network
Now we need to configuring MariaDB for Remote Client Access because this is disabled by default.
You can’t do this via the GUI so I’ve written this down in detail.
Start PUTTY and connect to the ip-adress of your Synology DiskStation and login.

Enter the command :
Code:
sudo su –
Type in your password and you’ll now have full access so be careful.
Enter the command :
Code:
cd /var/packages/MariaDB10/etc
Enter the command :
Code:
ls –al
If you do not see a file named ‘my.cnf’ enter the following commands:
Enter the command :
Code:
echo [mysqld] > my.cnf
echo skip-networking=0 >> my.cnf
echo skip-bind-address >> my.cnf
cat my.cnf
Now you should see the following output:
Code:
[mysqld]
skip-networking=0
skip-bind-address
If you already have a file called my.cnf, you should edit it accordingly.
TIP: make sure the my.cnf has [-rw-r--r—] permissions  (0444 and not 0777) otherwise :
chmod 0444 /var/packages/MariaDB10/etc/my.cnf

 
I also marked out the bind-address in the other my.cnf file at the location: /volume1/@appstore/MariaDB10/usr/local/mariadb10/etc/mysql . I’m not really sure this needs to be done but in my case it worked. Now some ‘vi’ instructions:
Enter the command :
Code:
cd /volume1/@appstore/MariaDB10/usr/local/mariadb10/etc/mysql
Enter the command :
Code:
cp my.cnf my.old

We just made a copy of the original file in case things go wrong.
Now we can safely edit the my.cnf file and 'mark out' the bind-address = 0.0.0.0 line  with an # character.
To do this just enter the command :

Code:
vi my.cnf

Now use the cursors to move down to the [mysqld] section and go to the line bind-address = 0.0.0.0.
Press the ‘i’ button once. (now you’re in insert mode)
Press the ‘#’ button once. (The #-character should be inserted at the beginning of the line)
Press the ‘ESC’ button once (now you left the insert mode again into command mode)
Type in wq! and press the enter button (wq! is the command for write+quit+override)

(If you`ve screwed up, enter the command : cp my.old my.cnf , and you’re back to where you were.)
Now MariaDB10 will accept TCP connections from your local network.
** You now must restart the MariaDB service or simply just reboot your DiskStation.**

 
  • Synology MariaDB – create and configure kodi user
At this point we need to create a kodi user in the MariaDB.
Login to your Synology DiskStation and open the Package Centre, start phpadmin and login.
  • Select the users tab
  • Click add user account
  • Username = kodi
  • Server name  = %
  • Password = Pa$$w0rd!  (You can choose your own password, but must use a complex password)
  • Enable the option select all privileges on wildcard name (username\_%)
  • Click the Select all next to the Global privileges option
  • Scroll down and press Go.

  • Configure KODI Devices with advancedsettings.xml
At this point the server part is done and you need to configure your KODI devices to use MariaDB on your Synology DiskStation. This cannot be done on the KODI GUI but needs to be done by creating an ‘advancedsettings.xml’ file in the userdata folder.

I’ll describe an Windows and Android (TVbox) KODI client, but other devices should be fairly similar.
Create a new text file and paste the code below.
Save this file with the name : advancedsettings.xml

xml:

<advancedsettings>
  <videodatabase>
    <type>mysql</type>
    <host>192.168.1.150</host><! --CHANGE TO YOUR OWN DISKSTATION ADRES -->
    <port>3306</port><! --DO NOT USE 3307 here -->
    <user>kodi</user>
    <pass>Pa$$w0rd!<pass><! --CHANGE WITH OWN PASSWORD -->
  </videodatabase>
  <musicdatabase>
     <type>mysql</type>
     <host>192.168.1.150</host><! --CHANGE TO YOUR OWN DISKSTATION ADRES -->
    <port>3306</port><! --DO NOT USE 3307 here -->
     <user>kodi</user>
     <pass>Pa$$w0rd!<pass><! --CHANGE WITH OWN PASSWORD -->
  </musicdatabase>
  <videolibrary>
    <importwatchedstate>true</importwatchedstate>
    <importresumepoint>true</importresumepoint>
    <cleanonupdate>true</cleanonupdate> <!-- Also clean library during library update -->
    <importwatchedstate>true</importwatchedstate>
    <hideallitems>true</hideallitems> <!-- removes the "*All" items from the video library -->
    <hideemptyseries>true</hideemptyseries>  <!-- hide empty series in the video library -->
  </videolibrary>
  <video>
    <excludefromscan>
      <regexp>\@eaDir</regexp>
      <regexp>\@eadir</regexp>
      <regexp>\@EADIR</regexp>
      <regexp>\#recycle</regexp>
      <regexp>-trailer</regexp>
      <regexp>[!-._ \\/]sample[-._ \\/]</regexp>
    </excludefromscan>
    <excludefromlisting>
      <regexp>\@eaDir</regexp>
      <regexp>\@eadir</regexp>
      <regexp>\@EADIR</regexp>
      <regexp>\.DS_Store</regexp>
      <regexp>-trailer</regexp>
      <regexp>[!-._ \\/]sample[-._ \\/]</regexp>
      <regexp>\#recycle</regexp>
    </excludefromlisting>
  </video>
  <network>
   <buffermode>1</buffermode> <!-- Default is 1 -->
   <cachemembuffersize>52428800</cachemembuffersize> <!-- Default is 20971520 bytes -->
   <readbufferfactor>2.0</readbufferfactor> <!-- Default is 1.0 -->
  </network>
</advancedsettings>

Don’t forget to edit the text above to reflect the IP address of your server on your LAN and the username/password of your MariaDB database. This basic setup should get your video and music libraries synced, but you can also sync other portions of Kodi, as well as sync multiple profiles with the name tag if you use them.
Now copy this advancedsettings.xml to the userdata folder of your KODI devices.
If you already have a fully configured KODI Device that makes use of video and audio files on your Synology NAS, you want all the others to be the same. Therefore copy the following files from that KODI device to the other devices in the userdata folder as well.
  • guisettings.xml
  • sources.xml  (This file contains information where your video and music files are located)
  • RssFeeds.xml
  • profiles.xml
 On a Windows Kodi device open folder C:\Users\.......\AppData\Roaming\Kodi\userdata
(If you can’t find AppData, enable the hidden files option in the view tab.)

Copy the newly created advancedsettings.xml to this folder.
 
On a Android (TVBox) device:
Install a file manager APP (e.g. Total Commander)
Start the file manager APP and go to the folder : Android/data/org.xbmc.kodi/files/.kodi/userdata
Copy the newly created advancedsettings.xml to this folder. (Including the other xml files if you want).
 
***  Now it’s time to start KODI on your device and all should work. ***
 
Check that databases are created in MariaDB10
Kodi will automatically create the two new databases configured in the advancedsettings.xml.
Open phpadmin and login.

Click on the Databases tab and you should see two new databases
  • MyMusic72 (The name will differ with KODI release)
  • MyVideos116 (The name will differ with KODI release)
Logout.
NOW…..For safety don’t forget to disable the SSH service again as described before.
 
Here are some additional KODI tips
KODI - movies - select files - long press movie - select 'add to library'
- this file contains - movies
- information supplier - The movie database
- settings - preffered language - <choose your own language> - press OK
- Press OK
- Do you want to renew all items in this location ?  - YES
 
KODI - series- select files - long press series- select 'add to library'
- this file contains - series
- information supplier - The movie database
- settings - preffered language -  <choose your own language> - press OK
- Press OK
- Do you want to renew all items in this location ?  - YES
 
KODI - Music - select files - long press music and select add to library - full index even if exists - yes.
 
Troubleshooting tips.
Important log  information can be found in the Kodi.log on your KODI device.
KODI Log file Windows : C:\Users\Computer\AppData\Roaming\Kodi\Kodi.log
KODI Log files ANDROID TVBOX : Android/data/org.xbmc.kodi/files/.kodi/temp/Kodi.log
 
MariaDB/MySQL problems.
Error : Unable to open database: MyVideos116 [2002](Can't connect to MySQL server on '192.168.1.150' (115))
ERROR 2002 (HY000): Can't connect to MySQL server on '192.168.1.100' (115)

 
  • Check what port mysql is running on
    PUTTY command : netstat anp | grep mysqld
    The last column shows you that mysqld bound itself to port 3306 listening on all interfaces.


  • Check there is a listener on mysql port
    PUTTY command : netstat ln | grep mysql
    You should see a listener with /run/mysqld/mysqld10.sock


  • Check if there is any network traffic when starting KODI
    PUTTY command : tcpdump port 3306
    Start KODI and you should see a lot of IP traffic rushing over your screen


  • Test the database connection using putty on 127.0.0.1 and 192.168.1.x
Start PUTTY, connect to your DiskStation on port 22 using SSH and login
Enter the command : cd /volume1/@appstore/MariaDB10/usr/local/mariadb10/bin
Enter the command : ./mysql --host=x.x.x.x --protocol=tcp --port=3306 -u kodi -p

(replace x.x.x.x with your DiskStation LAN ip-adress e.g. 192.168.1.150)
(don’t forget the ‘.’ Before /mysql !)

Enter the kodi password (in this example Pa$$w0rd)
If everything is configured OK, you should see :
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is x
Server version: 10.3.21-MariaDB Source distribution
Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
Enter the command : status
You should see output with the following lines:
Current user:           [email protected]
Connection:             192.168.1.x via TCP/IP
To Quit -> Enter the command : quit
 
If you get an error like ERROR 1045 (28000): Access denied for user 'kodi'@x.x..x.x' (using password: NO),  there is an obvious problem with the kodi user account, delete it and start again.
If you get an error like ERROR 2002 (HY000): Can't connect to MySQL server on '192.168.1.150' (115), the Database is not accepting connection from the LAN network. Try connecting to the localhost using the command : ./mysql --host=127.0.0.1 --protocol=tcp --port=3306 -u kodi -p
 
ERROR Connection refused
Start PUTTY, connect to your DiskStation on port 3306 using TELNET
If you get Connection refused it’s not ok. The MariaDB configuration or firewall is not enabled to accept connections from the (LAN) network. If you get Connection reset by peer its ok.
 
Configure php extensions
Login to your Synology DiskStation and open Web Station.
In Web Station > PHP Settings > Profile > Edit > Core tab Search > search for ‘socket’

mysqli.default_socket  > Value : /run/mysqld/mysqld10.sock
pdo.mysqli.default_socket  > Value : /run/mysqld/mysqld10.sock
In Web Station > PHP Settings > Profile > Edit > Core tab Search > search for ‘port’
mysqli.default_port  > Value : 3306
Reply
#2
Hey, thanks for this... I may or may not have to use it.
I set up my database on my Synology in 2016 and I have minimal recollection on how I did it!
Not sure if I'll need to start from scratch while doing a major drive upgrade and make a change in my RAID config from R6 to SHR.
Do you know how to back up the MariaDB database? I'm hoping I can do this and just transfer the info to my new volume once I get the new drives installed.
Reply
#3
Hi Wetsocks,
first I want to thank you for your input regarding this topic.
I have been reading some other, but outdated tutorials, on how to achieve thise shared database for kodi.
It would have helped me a lot if I have found this when I started.
Anyway, I could achieve this now but there is something very strange.
In fact for me to make it work, I had to use the port 3307 instead of 3306 in the qdvqncedsettings.xml file and I didn't add the 3306 in the firewall on the synology server.

I also thank you for your detailed explanations on how to set everything up and especially how to debug the whole thing, this was really helpfull.

See you ;-)
Reply
#4
1.  Thanks very much indeed for sharing your updated extensive guide here following your recent headaches with an initial set up.  Should others come across similar difficulties as well I hope they find your troubleshooting steps very useful Smile. ( I think I might have seen it before over on the Syno forum itself in the past too??)  As you've mentioned, there still aren't too many updated full step by step tutorials available for the whole MySQL/Kodi process, so an additional updated guide will hopefully prove useful Smile!!

2.  Glad you were able to workaround/work through what was happening in your case & fully resolve the problems too.  (Many might just have given up altogether, me quite possibly being among them lol Wink.)

Otherwise.....

At the time when I first set mine up, I watched or read at least 8 or 9 different step by step tutorials in the hope they'd guide me through setting up MySQL for Kodi but they were all dated roughly from 2011 to 2014 as you discovered.  I eventually found a couple of slightly later step by step guides so I was mainly using a Youtube video tutorial & a separate written tutorial from approx 2015 which obviously had significantly older versions of the DSM software to my NAS. (I also got some help on this forum too to questions I still wasn't certain about Smile.)  I specifically wanted tutorials that avoided any use of SSH/TELNET if it was possible too.  (I used to use & was very comfortable with SSH in the later 90's early 00's to compile/admin IRC servers etc., among many other uses.  Over time I simply stopped using or needing command line  SSH completely, so all that former knowledge & confidence using it was obviously just gone with time.). Thankfully, the tutorials I had found could get everything done to set up the server without needing SSH at all.  Although, the guides were made using considerably older versions of the DSM but the similarities or the information provided were still close enough & sufficient for me to fill in the gaps to get by with.  I managed to get the whole job done without so much as a single hiccup from start to finish Smile.

Out of interest, which PHP version did you install on your Syno NAS?  (Or alternatively, which version was installed by default by another package you had to install such as the web station package?  Are you using the old 5.6 or one of the 7.x versions?)  I configured one of my Syno NAS to run the MySQL server give or take a couple of years ago now & when I installed the web server package it installed PHP 5.6 by default so I just used that but I know it's end of life.  Thankfully, I didn't experience any of the unfortunate issues you apparently needed to extensively troubleshoot & correct as explained in your guide above.

I'm just on a light mobile device at the moment so I'd need to double check all of my settings/configuration from another device when I get the time.  However, I'm fairly sure that  MariaDB & my entire configuration are actually set to use 3307, a firewall rule also added to my Syno NAS for 3307, & all of my client Kodi  devices are definitely configured to connect using 3307 in the advancedsettings.xml too.  (I'm fairly certain (from my terrible memory Wink ) that nothing is using or configured for 3306 at all.)

As mentioned, I ran through the entire configuration following other users older step by step guides/tutorials which stated in their guides to use 3307, (as you've also made a specific point of in your guude as well), nevertheless I was still able to go through the entire process without any of the awful troubles you appear to have run in to by using 3307 yourself.

Am just wondering why that's the case?  (I certainly don't posses the knowledge for any definitive answers & you clearly know a lot more about it all than me Wink.)

My original MySQL server has been running absolutely flawlessly since day one & I've been extremely happy with it all Smile. However, I'm about to set up a brand new upgraded NAS as well & with Kodi 19 also now being so very close to release anyway -  I'm actually considering just having a completely fresh start with a whole new MySQL (MariaDB) server & new library on the new NAS rather than messing around with exporting/importing from one NAS to another, & across PHP versions too.  (It will take a little more time to redo everything from acratch again obviously but acceptable time or I would go the export/import route without so much as a second thought. Wink.)

Just wondering if there is an issue with one of the Synology PHP packages that you may possibly be using & avoid it (if possible).

I'll let you know if the same thing happens to me when I get around to sorting out all the new hardware & new server respectively Smile.

Hope you enjoy it all trouble free now & into the future.

Regards, & thanks again for taking the time to help others Smile.
Reply
#5
@Arctic_Wolf

Here is a Kodi forum tip: please don't quote entire large (opening) posts, we don't want to scroll down threads (as well as fill up our forum server) needlessly.
I understand it's the lazy thing to do what you did, but this forum software is smarter than that.

If you need to quote a relative portion of a post, simply select/mark that text with your mouse, and a "Reply" option will appear in the bottom left of that post.
Click on that Reply option, and that text will be copy/pasted as a quote into your reply text box. As simple as that.
You can also do with every small text portion you consider necessary.

Thanks in advance. Smile
Reply
#6
@Klojum ,

My apologies & point certainly taken Smile.  I more frequently use an Android tablet for forums which doesn't always show up all the same options a desk/laptop display has or function quite as seamlessly.  I also use other forums that have the "reply" feature but they condense any quoted replies right down into a box  with an "expand" option included to stop that "long quotation effect" to save others having to scroll through repeated info again etc.  (Obviously this forum engine/template has similar(ish) features but doesn't quite function in exactly the same manner as the other forums I'm more used to.)

All noted, however, & I'll remember that this particular forum displays quoted replies differently in the future Smile. Ultimately, given the actual length of the OP, I should have really just "@tagged" the OP anyway rather than replying to such a long post but the coffee obviously hadn't fully kicked in at the time I guess Wink.

Thanks for modifying.
Reply
#7
Thanks for the instructions. Great help, but didn't work for me but it put me in the right direction.
After some troubleshooting I saw no network connectivity on port 3306, I figured to try setting all ports to 3307.
Then I watched the logs from XBMC and I saw that there were errors in the advancedsettings.xml.

There is a typo in your advancedsettings.xml code.

Pass doesnt have correct closing tag.</pass>
This was my code, I removed the musicdatabase. Because I don't use it.

xml:
<advancedsettings>
  <videodatabase>
    <type>mysql</type>
    <host>192.168.1.180</host>
    <port>3307</port>
    <user>kodi</user>
    <pass>PUTYOURPASSWORDHERE</pass>
  </videodatabase>
  <videolibrary>
    <importwatchedstate>true</importwatchedstate>
    <importresumepoint>true</importresumepoint>
    <cleanonupdate>true</cleanonupdate> <!-- Also clean library during library update -->
    <importwatchedstate>true</importwatchedstate>
    <hideallitems>true</hideallitems> <!-- removes the "*All" items from the video library -->
    <hideemptyseries>true</hideemptyseries>  <!-- hide empty series in the video library -->
  </videolibrary>
  <video>
    <excludefromscan>
      <regexp>\@eaDir</regexp>
      <regexp>\@eadir</regexp>
      <regexp>\@EADIR</regexp>
      <regexp>\#recycle</regexp>
      <regexp>-trailer</regexp>
      <regexp>[!-._ \\/]sample[-._ \\/]</regexp>
    </excludefromscan>
    <excludefromlisting>
      <regexp>\@eaDir</regexp>
      <regexp>\@eadir</regexp>
      <regexp>\@EADIR</regexp>
      <regexp>\.DS_Store</regexp>
      <regexp>-trailer</regexp>
      <regexp>[!-._ \\/]sample[-._ \\/]</regexp>
      <regexp>\#recycle</regexp>
    </excludefromlisting>
  </video>
  <network>
   <buffermode>1</buffermode> <!-- Default is 1 -->
   <cachemembuffersize>52428800</cachemembuffersize> <!-- Default is 20971520 bytes -->
   <readbufferfactor>2.0</readbufferfactor> <!-- Default is 1.0 -->
  </network>
</advancedsettings>

And you can set accept incoming tcp connections directly in MariaDB in Synology Package Center.

So in short: all ports on 3307, correct closing pass tag if you copy the advancedsettings code from here.
Reply
#8
Just in case anyone else encounters this problem, I've spent the last day tearing my hair out trying to connect Kodi (Libreelec on a Raspberry Pi) to a MariaDB10 database on my Synology NAS.

I couldn't see any traffic hitting the NAS, regardless of port used or how I setup MariaDB or the Kodi advanced settings file.

The fix was to make sure the 'wait for network before loading' option was selected in the Libreelec settings GUI. Looks like it wasn't firing up the MySQL bits in order to connect as the network link wasn't up. Changed that and it all worked like a charm (on port 3307).
Reply
#9
Well spotted @WBFT Wink.

@Wetsocks , as previously mentioned above I've tested another completely fresh configuration of a Kodi MySQL server on my new Syno NAS & I haven't run into any of the issues you had.  (Perhaps WBFT has identified your specific issue, however.)

I simply installed the MariaDB 10 & Web Station packages which this time installed the PHP 7.2 package by default, installed PHPMyAdmin, & otherwise left everything set to 3307.  Following the usual configuration I was back up & running again with a freshly compiled library in minutes.

Job done & none of the headaches you experienced whatsoever Smile.

(BTW WBFT, you have a second unnecessary "importwatchedstate" entry in your advancedsettings.xml file example that you pasted in above too mate lol Wink.  (Lines 10 and 13 respectively Wink.))
Reply
#10
I have the same setup but then MariaDB en PHPmyadmin as docker on a new DS920+ without the exclude and importstatus. Previously I had it my DS211 and everything was working fine.

The problem which I have now is that watchedstatus is not being synced between the two kodi devices. The only change I have is that my media PC has Kodi v19 and my raspberry has LibreElec v18.9.

Does the watchstatus not sync between different versions of Kodi? Or do I need to use the importwatchestatus/resumepoint?
Kodi v20.1,Nokia Streaming BOX 8000 & 8010 , Synology DS920+, Polestar 2. Amsterdam, Netherlands
Reply
#11
No, as stated on the wiki MySQL (wiki) page, the major versions (v18.x vs v19.x) need to be the same.

Each version of Kodi uses a different version of the databases (wiki), so your LE Pi will be writing to MyVideos116 whereas the PC with Matrix will be writing to MyVideos119. If you look on the server you will see both databases being held there (when you first upgraded the PC from Leia to Matrix, it will have updated the database from 116 to 119, but the old version remains behind).

So from that point the two are separate entities, and as the watched status is stored in there then they won't sync any more. Once you update the Pi to Matrix then they will sync again, although of course any watched status (or indeed any other entries) in the MyVideos116 will be lost as that database will no longer be used.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#12
(2021-04-14, 23:08)DarrenHill Wrote: No, as stated on the wiki MySQL (wiki) page, the major versions (v18.x vs v19.x) need to be the same.

Each version of Kodi uses a different version of the databases (wiki), so your LE Pi will be writing to MyVideos116 whereas the PC with Matrix will be writing to MyVideos119. If you look on the server you will see both databases being held there (when you first upgraded the PC from Leia to Matrix, it will have updated the database from 116 to 119, but the old version remains behind).

So from that point the two are separate entities, and as the watched status is stored in there then they won't sync any more. Once you update the Pi to Matrix then they will sync again, although of course any watched status (or indeed any other entries) in the MyVideos116 will be lost as that database will no longer be used.
So that's why I saw two different Myvideo in my database. Good to know, now I hope LibreElec will quickly go to v19. Thanks for the help!
Kodi v20.1,Nokia Streaming BOX 8000 & 8010 , Synology DS920+, Polestar 2. Amsterdam, Netherlands
Reply
#13
(2021-04-14, 23:22)TyKH Wrote: now I hope LibreElec will quickly go to v19

LibreELEC is already using Kodi 19, albeit on beta and nightly releases.
Reply
#14
I also wanted to thank you for this write-up and agree that I had to fix the two </pass> tags, and I also had to use port 3307 before this would work.
I am on DSM 6.2 and PHP 7.3, in case that helps anyone.

As further potential help, if someone is on Windows 10 (using the store version of this app), here's an example of the path for your userdata folder:
 C:\users\*youruserid*\AppData\Local\Packages\XBMCFoundation.Kodi_(suffix may vary)\LocalCache\Roaming\Kodi\userdata

...and if someone is on Windows 10 (using the store version of this app), this an example path for where you can find the kodi.log file:
 C:\users\*youruserid*\AppData\Local\Packages\XBMCFoundation.Kodi_(suffix may vary)\LocalCache\Roaming\Kodi\kodi.log

Once more, many thanks!
Reply
#15
Thanks for this write up.  Some good ideas for my advancedsettings.xml settings file.

Though I'd offer some updated info, and maybe skip some steps for people.

1. Install MariaDB.
2. Click Open if the screen doesn't appear after setting the password. Enable TCP/IP connection if it isn't checked. Update it to 3306 either way. (Not everyone uses a firewall)
3. SSH in, only the /var/packages/MariaDB10/etc/my.cnf is needed
4. No need for phpadmin. SSH in, run "/usr/local/mariadb10/bin/mysql -u root -p" and use the password created to admin the DB
5. Run this command "GRANT ALL ON *.* TO '<username>'@'%' IDENTIFIED BY '<password>' WITH GRANT OPTION;"
6. Run 'flush privileges;'
7. type quit to exit MariaDB.

And it is ready to go.
Reply

Logout Mark Read Team Forum Stats Members Help
How to centralize KODI mySQL library with Synology MariaDB100