Jump to content

Help with Mariadb docker


Mobius71

Recommended Posts

I have tried to get this working for a shared database setup for xbmc/kodi, but I cannot get xbmc to connect

I'm using needos Maria docker and I add the user and permissions with docker exec and have verified the xbmc user exists and has all pemissions, but still no connection to the database. Logs for xbmc show either cannot connect error with decending database numbers or that number of connections exceeded by xbmc. My advanced settings file is the standard setup as well for a shared library. I had mysql working previously on my desktop before this but using docker has thrown me for a loop. Any ideas or suggestions?

Link to comment

I've attached a screenshot of my mariadb docker config page.  I've tried this mapping to both "/mnt/cache/Apps/mariadb/" and also "/mnt/user/Apps/mariadb/" with no luck.  I've also tried changing from bridge to host mode with no luck either. 

 

Here's my advancedsettings.xml as well:

 

<advancedsettings>

  <videodatabase>

    <type>mysql</type>

    <host>192.168.2.25</host>

    <port>3306</port>

    <user>xbmc</user>

    <pass>xbmc</pass>

  </videodatabase>

  <musicdatabase>

    <type>mysql</type>

    <host>192.168.2.25</host>

    <port>3306</port>

    <user>xbmc</user>

    <pass>xbmc</pass>

  </musicdatabase>

  <videolibrary>

    <importwatchedstate>true</importwatchedstate>

    <importresumepoint>true</importresumepoint>

<backgroundupdate>true</backgroundupdate>

<updateonstartup>true</updateonstartup>

  </videolibrary>

</advancedsettings>

mariadb_docker_config.JPG.a58e1dc83520210909b8c60b5f6c62d6.JPG

Link to comment

I have already tried mysql workbench and heidisql as well.  They both show the user xbmc and the proper permissions and the music and video databases are getting created, but the databases are empty.  I've tried nuking the container and  creating a new one, as well as nuking the container and image and starting from scratch multiple times.  Still no luck.

Link to comment

Trying to help as I can here..

 

I have this working, with the same container and multiple Kodi clients.

 

Your MariaDB screen shot looks fine, matches mine.

The weird thing is that you have the MyVideos/Music databases's with nothing in them!

 

For my setup I made the MariaDB docker, and added the username/password (xbmc) using workbench, and gave it full permissions (I don't believe it needs all of them, but I didn't care.).

 

Are you editing your advancedsettings.xml in a "friendly" editor?

I recommend Notepad++ if you are using Windows, in the Unix/OSX format.

 

To see if it helps I have added my advancedsettings file to this post, please modify with your IP and test.

You could remove the junk at the bottom, but I like the set skip back times at 7 seconds..  :P

Trying to help diagnose, we'll start there.

advancedsettings.zip

Link to comment

Thanks bungee.  I have been strictly using notepad++ for this sort of thing for years now.  I will modify and try your advanced settings file and post back with an update.  It's probably something small that I'm missing (hopefully). Thanks for your help!

Link to comment

I think you need to add to advancedsettings.xml database information. If you had previous version of XBMC working (existing database) than Kodi would simply create new database and move over all the tables and it takes couple minutes.

 

<videodatabase>MyVideos</videodatabase>

<musicdatabase>MyMusic</musicdatabase>

 

MyVideos and MyMusic are default names, but you can use different ones, Kodi will add necessary number at the end

 

See also if your older database contains any data. If it does, than delete MyVideos90 and MyMusic48 (Kodi 14.2), edit advancedsettings.xml and start Kodi to initiate process again.

 

Link to comment

if you're using my kodi headless container, then the inputting of the mysql ip, port , user and passwd are all handled by variables.

 

 

trying to manually edit them will likely result in messing up the start routine adding them and a mess, in short, DON'T DO IT.

Link to comment

i have 2 questions.

 

what is the ip address of your unraid box

 

and

 

what mysql commands did you use to set up the user

 

 

EDIT:

 

actually make it 3 questions.

 

do you have any data from other containers using the mariadb container.

 

because if not, i'd propose a complete start from scratch and i'll walk you through the best way to set it up.

Link to comment

You may want to check to ensure that the xbmc user can access the db from anywhere. Depending on how you created your users they may have had root privilege, but not from anywhere. I noticed HeidiSQL likes to default to the most secure values via it's user creation GUI.

Link to comment

if you're not using my headlesss container, why the hell not ? lol.

 

Ha. Mostly because I couldn't even get the headless docker to write to the database either. 

 

 

i have 2 questions.

 

what is the ip address of your unraid box

 

and

 

what mysql commands did you use to set up the user

 

 

EDIT:

 

actually make it 3 questions.

 

do you have any data from other containers using the mariadb container.

 

because if not, i'd propose a complete start from scratch and i'll walk you through the best way to set it up.

 

1) My ip for unraid is 192.168.2.25.  It's a static ip.

2) I used the commands I used are as follows:

    docker exec -it MariaDB bash

    Then I  used mysql -u root (since theres no root password for the docker)

    This gives me an error for TERM so I then use 'export TERM=xterm' (This allows me to issue the commands)

    CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';  and I hit return (I'm still on Gotham, so I'm sticking with xbmc,xbmc for now)

    GRANT ALL ON *.* TO 'xbmc'; and I hit return

    Then I exit with \q.

3) I don't have any other containers using the mariadb container.  I wish I did so I would know if its a prob with openelec and not docker or vice versa, but yeah.

 

I'd love a walkthrough if it's not too much trouble.  Like I mentioned before I had a shared mysql database working on a windows machine, but moving to docker has been a no go so far for me.

Link to comment

if you're not using my headlesss container, why the hell not ? lol.

 

Ha. Mostly because I couldn't even get the headless docker to write to the database either. 

 

 

i have 2 questions.

 

what is the ip address of your unraid box

 

and

 

what mysql commands did you use to set up the user

 

 

EDIT:

 

actually make it 3 questions.

 

do you have any data from other containers using the mariadb container.

 

because if not, i'd propose a complete start from scratch and i'll walk you through the best way to set it up.

 

1) My ip for unraid is 192.168.2.25.  It's a static ip.

2) I used the commands I used are as follows:

    docker exec -it MariaDB bash

    Then I  used mysql -u root (since theres no root password for the docker)

    This gives me an error for TERM so I then use 'export TERM=xterm' (This allows me to issue the commands)

    CREATE USER 'xbmc' IDENTIFIED BY 'xbmc';  and I hit return (I'm still on Gotham, so I'm sticking with xbmc,xbmc for now)

    GRANT ALL ON *.* TO 'xbmc'; and I hit return

    Then I exit with \q.

3) I don't have any other containers using the mariadb container.  I wish I did so I would know if its a prob with openelec and not docker or vice versa, but yeah.

 

I'd love a walkthrough if it's not too much trouble.  Like I mentioned before I had a shared mysql database working on a windows machine, but moving to docker has been a no go so far for me.

 

well, you seem to have done everything i would have said for you to do anyways, with one caveat

 

i normally issue a

 

flush privileges;

 

after any sql commands.

 

 

is your media share password protected ?

Link to comment

I just pulled the last mysql_safe log file. This is a bit different from what I was seeing before.

 

150529 06:53:35 mysqld_safe Starting mysqld daemon with databases from /db

150529  6:53:35 InnoDB: The InnoDB memory heap is disabled

150529  6:53:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins

150529  6:53:35 InnoDB: Compressed tables use zlib 1.2.8

150529  6:53:35 InnoDB: Using Linux native AIO

150529  6:53:35 InnoDB: Initializing buffer pool, size = 128.0M

150529  6:53:35 InnoDB: Completed initialization of buffer pool

InnoDB: The first specified data file ./ibdata1 did not exist:

InnoDB: a new database to be created!

150529  6:53:35  InnoDB: Setting file ./ibdata1 size to 10 MB

InnoDB: Database physically writes the file full: wait...

150529  6:53:35  InnoDB: Log file ./ib_logfile0 did not exist: new to be created

InnoDB: Setting log file ./ib_logfile0 size to 5 MB

InnoDB: Database physically writes the file full: wait...

150529  6:53:35  InnoDB: Log file ./ib_logfile1 did not exist: new to be created

InnoDB: Setting log file ./ib_logfile1 size to 5 MB

InnoDB: Database physically writes the file full: wait...

InnoDB: Doublewrite buffer not found: creating new

InnoDB: Doublewrite buffer created

InnoDB: 127 rollback segment(s) active.

InnoDB: Creating foreign key constraint system tables

InnoDB: Foreign key constraint system tables created

150529  6:53:35  InnoDB: Waiting for the background threads to start

150529  6:53:36 Percona XtraDB (http://www.percona.com) 5.5.37-MariaDB-34.0 started; log sequence number 0

150529  6:53:36 [Note] Plugin 'FEEDBACK' is disabled.

150529  6:53:36 [Note] Server socket created on IP: '0.0.0.0'.

150529  6:53:36 [Note] Event Scheduler: Loaded 0 events

150529  6:53:36 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.5.37-MariaDB-0ubuntu0.14.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)

150529  6:53:38 [Note] /usr/sbin/mysqld: Normal shutdown

 

150529  6:53:38 [Note] Event Scheduler: Purging the queue. 0 events

150529  6:53:38  InnoDB: Starting shutdown...

150529  6:53:39  InnoDB: Shutdown completed; log sequence number 1597945

150529  6:53:39 [Note] /usr/sbin/mysqld: Shutdown complete

 

150529 06:53:39 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

150529 06:53:40 mysqld_safe Starting mysqld daemon with databases from /db

150529  6:53:40 InnoDB: The InnoDB memory heap is disabled

150529  6:53:40 InnoDB: Mutexes and rw_locks use GCC atomic builtins

150529  6:53:40 InnoDB: Compressed tables use zlib 1.2.8

150529  6:53:40 InnoDB: Using Linux native AIO

150529  6:53:40 InnoDB: Initializing buffer pool, size = 128.0M

150529  6:53:40 InnoDB: Completed initialization of buffer pool

150529  6:53:40 InnoDB: highest supported file format is Barracuda.

150529  6:53:40  InnoDB: Waiting for the background threads to start

150529  6:53:41 Percona XtraDB (http://www.percona.com) 5.5.37-MariaDB-34.0 started; log sequence number 1597945

150529  6:53:41 [Note] Plugin 'FEEDBACK' is disabled.

150529  6:53:41 [Note] Server socket created on IP: '0.0.0.0'.

150529  6:53:41 [Note] Event Scheduler: Loaded 0 events

150529  6:53:41 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.5.37-MariaDB-0ubuntu0.14.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)

150529  6:56:27 [Note] /usr/sbin/mysqld: Normal shutdown

 

150529  6:56:27 [Note] Event Scheduler: Purging the queue. 0 events

150529  6:56:27  InnoDB: Starting shutdown...

150529  6:56:28  InnoDB: Shutdown completed; log sequence number 1597945

150529  6:56:28 [Note] /usr/sbin/mysqld: Shutdown complete

 

150529 06:56:28 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

150529 06:56:33 mysqld_safe Starting mysqld daemon with databases from /db

150529  6:56:33 InnoDB: The InnoDB memory heap is disabled

150529  6:56:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins

150529  6:56:33 InnoDB: Compressed tables use zlib 1.2.8

150529  6:56:33 InnoDB: Using Linux native AIO

150529  6:56:33 InnoDB: Initializing buffer pool, size = 128.0M

150529  6:56:33 InnoDB: Completed initialization of buffer pool

150529  6:56:33 InnoDB: highest supported file format is Barracuda.

150529  6:56:33  InnoDB: Waiting for the background threads to start

150529  6:56:34 Percona XtraDB (http://www.percona.com) 5.5.37-MariaDB-34.0 started; log sequence number 1597945

150529  6:56:34 [Note] Plugin 'FEEDBACK' is disabled.

150529  6:56:34 [Note] Server socket created on IP: '0.0.0.0'.

150529  6:56:34 [Note] Event Scheduler: Loaded 0 events

150529  6:56:34 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.5.37-MariaDB-0ubuntu0.14.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)

150529  7:03:08 [Warning] IP address '192.168.2.4' could not be resolved: Name or service not known

150529  7:07:43 [Warning] IP address '192.168.2.2' could not be resolved: Name or service not known

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...