Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Connection refused when adding SMB with MySQL - openSUSE Leap 15
#1
Hi all,

I have a UDOO X86 Advanced Plus, running openSUSE Leap 15 with MariaDB/mysql
Done the following to setup KODI and mysql on it:


add packman repo.
zypper dup --from packman
sudo pkill mysql
systemctl stop mariadb

Next, started the service with --skip-grant-tables:

sudo systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
systemctl start mariadb
systemctl status mariadb
This will allow you to connect to the database server as root without a password (openSUSE comes with mariaDB installed,so I don't know the password.

mysql -u root

USE mysql;
UPDATE user SET password=PASSWORD('NewPasswordHere') WHERE User='root' AND Host = 'localhost';
FLUSH PRIVILEGES;
\q

Stop the service, unset the environment variable and start the service once again:

systemctl stop mariadb
sudo systemctl unset-environment MYSQLD_OPTS
systemctl start mariadb

Enable the service so it starts at startup:

systemctl enable mariadb

Above taken from: https://www.tecmint.com/reset-mysql-or-m...-password/

mysql -u root -p

CREATE USER 'udoo'@'%' IDENTIFIED BY 'udoo';
CREATE USER 'udoo'@localhost IDENTIFIED BY 'udoo';
GRANT ALL PRIVILEGES on *.* TO 'udoo'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
\q

sudo nano /etc/my.cnf

change the bind-address to:

bind-address = 0.0.0.0

sudo service mysql restart

sudo smbpasswd -a simorgh

sudo nano /etc/samba/smb.conf

-> add these lines at the end of smb.conf
[media]
path = /home/simorgh/media
valid users = simorgh
read only = no

Restart samba:
sudo systemctl restart nmb smb

In firewall application under YaST : options > 'change default zone' > Home
open 8080 port for tcp and udp
open samba and mysql ports

Install KODI first and start it for at least once!
IMPORTANT!!! IMPORTANT!!! IMPORTANT!
Start KODI on server side at least once and let it populate the database without mysql or advancedsettings.xml (just celan KODI)

in Kodi : Service Settings > Control > port: 8080 , username: udoo , password: udoo
and turn on: "Allow remote control from applications on other systems"

nano ~/.kodi/userdata/advancedsettings.xml

...
<!-- MySQL Library -->

<videodatabase>
<type>mysql</type>
<host>127.0.0.1</host>
<port>3306</port>
<user>udoo</user>
<pass>udoo</pass>
</videodatabase>
...

This is my setup.

Now when I go to KODI and want to add videos > Browse> Add network location >Protocol SMB > server name : 10.0.1.130 > username : simorgh > password : 'MyPass' > OK
It says connection refused.

in mysql:
Quote:MariaDB [(none)]> select User, host, password FROM mysql.user;
+------+-------------+-------------------------------------------+
| User | host        | password                                  |
+------+-------------+-------------------------------------------+
| root | localhost   | *B81F0458ACE8C3A656116352C9A33B62EC67692C |
| root | simorghudoo |                                           |
| root | 127.0.0.1   |                                           |
| root | ::1         |                                           |
|      | localhost   |                                           |
|      | simorghudoo |                                           |
| udoo | localhost   | *9292B681E5729F5581650DC8C1B44F400B4114D8 |
| udoo | %           | *9292B681E5729F5581650DC8C1B44F400B4114D8 |
+------+-------------+-------------------------------------------+
8 rows in set (0.00 sec)

Has anyone have an idea what I am missing?

Appreciate any help.

Regards
Reply
#2
The MySQL/MariaDB database has nothing to do with SMB connections. The database only stores data, it's not involved in network connections.

Right now you have 2 udoo users, one for localhost and one for 'everything'. The localhost one can be removed.

For the "Connection refusted" message, double-check your Samba server version. Kodi now defaults to SMB versions 2 and up (which do not support network browsing anymore).
Reply
#3
Thank you for your reply. Much appreciated.

Samba version 4.7.10-git.124.8d97fe90926lp150.3.9.1-SUSE-oS15.0-x86_64

For some reason the firewall port was not open.
So I managed to populate my media on the server side.
Now when I run KODI on the client side, even though in the advanceddettings.xml it says:
...
<!-- MySQL Library -->
<videodatabase>
<type>mysql</type>
<host>10.0.1.130</host>
<port>3306</port>
<user>udoo</user>
<pass>udoo</pass>
</videodatabase>

...

The clients won't populate the media off of the server side.

is there now something wrong in the MySQL side?

Thank you for your help.
Reply
#4
(2019-03-02, 15:11)Simorgh Wrote: The clients won't populate the media off of the server side.

Please provide a full debug log (wiki) file from your Kodi client device.
You can also enable the Database component for the debugging.
Then restart Kodi and reproduce the problem, stop Kodi and provide the kodi.log file via a pastebin website.

A MySQL connection log entry alone doesn't say much.
Reply
#5
Thank you for your reply. Much appreciated.

The debug file from one of the clients, is uploaded at:
https://paste.kodi.tv/fuvinegeve

Thank you in advanced.
Reply
#6
That log file is simply not useful. Not much happens if anything, and no mention of any SMB access.
Show us a log with something actually happening.
Reply
#7
Does this one help:

https://paste.kodi.tv/adakitakij
https://paste.kodi.tv/qebilafeca
Reply
#8
(2019-03-02, 18:44)Simorgh Wrote: Does this one help:

The 1st one is not doing anything either.

The 2nd one shows network activity via SMB/Samba, but it seems to do fine. I don't see a problem or an error.
Reply
#9
The server with mysql (10.0.1.130) has populated the media and created the MyVideos107.db
in mysql:
MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| MyVideos107        |
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+
5 rows in set (0.00 sec)

MariaDB [(none)]> SHOW GRANTS FOR udoo@'%';
+--------------------------------------------------------------------------------------------------------------------------------+
| Grants for udoo@%                                                                                                              |
+--------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'udoo'@'%' IDENTIFIED BY PASSWORD '*9292B681E5729F5581650DC8C1B44F400B4114D8' WITH GRANT OPTION |
+--------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

And in /etc/my.cnf I have commented out # bind-address = 0.0.0.0 so the database can be accessed from others.

and on the client side I have these in the advancedsettings.xml:

...
<!-- MySQL Library -->

<videodatabase>
<type>mysql</type>
<host>10.0.1.130</host>
<port>3306</port>
<user>udoo</user>
<pass>udoo</pass>
</videodatabase>
...

normally the client(s) would connect to the server (10.0.1.130) and show the media populated on the server.
But the client shows an empty library on Movies tab.

Am I missing something?

Thanks in advanced for any help.
Reply

Logout Mark Read Team Forum Stats Members Help
Connection refused when adding SMB with MySQL - openSUSE Leap 150