[Wiki] Install and configure mysql server and clients


On the server

Install mysql server, this will ask you to create a password, remember it and keep it safe!

sudo apt-get install mysql-server

Log in to mysql and add the user kodi and give it relevant permissions:


Edit the mysql config file to allow access from other devices:
sudo vim /etc/mysql/my.cnf

Fine the line starting ‘bind-address’ and change it to the below, this will allow access from more than localhost

bind-address =

Restart the mysql server:
sudo service mysql restart

All done on the server!

On the client(s)

nano ~/.kodi/userdata/advancedsettings.xml

Paste this after replacing XXX.XXX.XXX.XXX with the IP address of the server that you’ve installed mysql-server on:


Press ctrl + x to save the file.

If this is a second client being connected to the mysql server copy the sources.xml file over, on the client that’s already setup:

scp ~/.kodi/userdata/sources.xml osmc@XXX.XXX.XXX.XXX:~/.kodi/userdata/

Where XXX.XXX.XXX.XXX is the IP address of the device you have just setup to connect to the mysql server.

Done (hopefully)

Multiple Vero4k with one DB
mySQL woes

Please edit your post to point out that the client setup must use the ip address of the server and not just copy/paste your text. Also please add music database


Cheers for the pointers, updated!


Isn’t MySQL server in the app store?


I looked and couldn’t find it, I’ll check again and if so I’ll delete this thread


I am not clos the to my OSMC so couldn’t check. But I just had the gut feeling it has


I don’t think it is, not sure why.


There is an experimental LAMP app, which includes MySQL but it is not publicly in the Store.

I can add it with a default password of OSMC if people want


Adding it would be nice thank you, the main reason for this mini tutorial though was to show what needed to be done once you had installed mysql and how to configure the clients and servers.


ALL of this info/direction is provided by Kodi itself in the wiki as none of it is quite specific to OSMC. I really don’t have a problem with adding it to our HowTo sub but I think you should also provide the official link from Kodi as well.



Can put that link on there, I found I had to tweak the mysql slightly to get it to work, and the instructions could be a little vague for some osmc users, I had to change the service restart code, and the scp of the advancedsettings.xml wasn’t included. No major chsnges and nothing complex, just a little easier imo.

My idea was to make this a mini tutorial for osmc users so they don’t have to go digging around, just like all the other howto’s on here.


Looks good. You can also configure SQL via My OSMC, which is handy for some users who are shy of the command line

I’ll send you some info about contributing to the Wiki, I need all the help I can get there!



4 posts were split to a new topic: mySQL woes

mySQL woes

Thank you for your post.
Could you please change this line in your post:

CREATE USER ‘osmc’@’%’ IDENTIFIED BY 'osmc’;


CREATE USER 'osmc'@'%' IDENTIFIED BY 'osmc';

’ instead of ’

Thank you in advance.

mySQL woes

:vulcan: heh?

mySQL woes

3 posts were split to a new topic: MySQL settings not working - Moved to a help request topic


I’ve been trying to follow the guide and and it seems things have changed meanwhile a bit…
So the steps I needed to take as of 13th January 2018 on OSMC 17.6 with a Debian Stretch fork:
Install MySQL (MariaDB in fact as replacement of MySQL)
sudo apt-get install mysql-server
confirm the extra packages and wait the installation to complete

Login the DB
sudo mysql

Create DB user
create user 'osmc' identified by 'osmc';

Give grants
grant all on *.* to 'osmc';

Reload privs
flush privileges;

Exit the DB console

Now we need to change MariaDB conf file to allow access from other hosts than localhost
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
locate the line
bind-address =
and change the IP
bind-address =
Ctrl+X to exit, confirm you want to save the file

Restart the service
sudo service mysql restart

Follow the client setup of the original guide