Page 1 of 2
MythTV backend config problem.
Posted: Thu Jun 28, 2018 6:51 pm
by pinnerite
Every few years I get MySQL problems when trying to setup mythtv (although running on MariaDB).
I had backed up all the MySQL databases from my working Mageia 5 drive on this machine.
I had installed Mint 18.3 on a spare drive and now wanted to instal and configure mythtv, both back and frontends..
This time it started with mythbackend-setup . (as the regular user i.e. not as root): This generated:
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.5' (111 "Connection refused"
Running sudo mysql -u root produced this:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
The ip address '192.168.0.5' is the static address for this machine and corresponds with the hostname: albury.asandco.
That is in my.cnf at /etc/alternatives and and at etc/mysql.
/etc/mythtv/config.xml has this:
<Configuration>
<Database>
<PingHost>1</PingHost>
<Host>192.168.0.5</Host>
<UserName>mythtv</UserName>
<Password>mythtv</Password>
<DatabaseName>mythconverg</DatabaseName>
<Port>3306</Port>
</Database>
<WakeOnLAN>
<Enabled>0</Enabled>
<SQLReconnectWaitTime>0</SQLReconnectWaitTime>
<SQLConnectRetry>5</SQLConnectRetry>
<Command>echo 'WOLsqlServerCommand not set'</Command>
</WakeOnLAN>
</Configuration>
The key lines regarding mysql.sock in both copies of my.cnf are
[client]
user = root
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
user = mysql
datadir = /var/lib/mysql
port = 3306
socket = /var/lib/mysql/mysql.sock
I didn't set a root password in MySQL
In desperation I created a file mysql.sock at /var/lib/mysqlbut that didn't seem to help.
Judging by web searches, the offered solutions seem to work for everyone but me!.
Suggestions will be very welcome indeed
Re: MythTV backend config problem.
Posted: Fri Jun 29, 2018 8:17 am
by MikeB2013
Which version of mythtv have you installed on Mint 18.3 ? (it helps to know the version, as there are some configuration differences between versions of mythtv).
I am assuming mythtv version 0.28 or later.
First thing to check is that you can get into mysql using mythtv credentials e.g "mysql -umythtv -p"
Note that the install of mythtv will have created a new random 8 character alpha-numeric password for mythconverg database, so your old password of "mythtv" in config.xml will not work. You need to use the new password (normally found in /etc/mythtv/config.xml) or change the mythtv password in mysql (if you did not setup a new root password for mysql during the install, you might find "sudo mysql" will get you in).
Re: MythTV backend config problem.
Posted: Fri Jun 29, 2018 11:06 am
by peteh
It looks to me as though mysql isn't started. Try
Re: MythTV backend config problem.
Posted: Fri Jun 29, 2018 11:08 am
by pinnerite
Than you for responding.
The MythTV version is 28.0
"mysql -umythtv -p" and similar statements do not get me in to mysql (MariaDB)
The password in
/etc/mythtv/config.xml is as shown in my original message above, viz:
//
<Host>192.168.0.5</Host>
<UserName>mythtv</UserName>
<Password>mythtv</Password>
<DatabaseName>mythconverg</DatabaseName>
<Port>3306</Port>
//
Attempting # mysql just gets me:
ERROR 2002 (HY000): Can't connect to .........'192.168.0.5' (111 "Connection refused"
Re: MythTV backend config problem.
Posted: Fri Jun 29, 2018 2:11 pm
by bill6502
I'd suggest looking at the bind-address setting. Be careful to follow my.cnf lines like
Code: Select all
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
(I'm assuming we're talking only about files under /etc/mysql)
noting the order if the includes. Sometimes users put changes to
things in mysqld.cnf in error. Then when the package manager
releases a new copy of the file, their changes get overwritten.
I prefer: /etc/mysql/mariadb.conf.d/mythtv.cnf, but anything that
gets used alphabetically after all other .cnf files is good. Mine looks
like this:
Re: MythTV backend config problem.
Posted: Fri Jun 29, 2018 2:34 pm
by MikeB2013
If you need to change mythtv password for mythconverg database you need to get into mysql/mariadb see
https://linuxconfig.org/how-to-reset-ro ... aver-linux
The "Reset by using skip-grant-tables" option will probably be needed.
I have just checked on a clean install of Mint 18.3 with mariadb Ver 15.1 Distrib 10.0.34 installed and it worked using skip-grant-tables option. The mysql_secure_installation did not throw any errors, but mysql -u root -p gave access denied when using the password I setup.
The skip-grant-tables option also worked on Xubuntu 18.04 with mysql Ver 14.14 Distrib 5.7.22
Re: MythTV backend config problem.
Posted: Fri Jun 29, 2018 4:42 pm
by pinnerite
Sorry peteh. $ sudo systemctl start mysql just hangs.
And sorry Bill6502, the 'includes' at the foot of my cnf only had:
!includedir /etc/my.cnf.d
but the file my.cnf.fallback only had one uncommented line, which I have added to the more complete version of my.cnf, copied over from a successfully working Mageia 5 + mythtv
Adding !includedir /etc/mysql/conf.d/ made no difference.
/etc/mysql/mariadb.conf.d/ doesn't exist on my machine.
I have restored my original bind address:
bind-address=192.168.0.5
Finally Mike2013,
# mysql_safe --skip-grant-tables &
complains that it cannot create/write file /var/log/mysql/mysql.log (Err 2 No such file or directory)
and then hangs. I left if over an hour before terminating it.
i am so grateful for you all giving your time.
What else is left?
Re: MythTV backend config problem.
Posted: Fri Jun 29, 2018 5:26 pm
by bill6502
If you changed the bind-address, then is the error message the same? See what
mysql -h 192.168.0.5 -u mythtv -pmythtv mythconverg says.
If
sudo systemctl start mysql hangs, then what does
systemctl status mysql
say. Need to understand if your system is using systemd (I'm a *buntu 16.04 & 18.04 user.)
Note that the service name can be different on different distributions and/or
SQL servers. One of:
mysql.service, mysqld.service or mariadb.service could exist. You said
initially that you MariaDB in the 1st post.
mysqld --version will confirm
what's in play.
Go to
/var/log/mysql and look at the logs there for clues.
You also mentioned the socket problems. Mine are in
/var/run/mysqld/mysqld.sock,
so it gets removed/recreated on every reboot. I wouldn't create the file manually.
Mine looks like this (but you don't have to put it where mine is)
Code: Select all
$ ll /var/run/mysqld/mysqld.sock
srwxrwxrwx 1 mysql mysql 0 Jun 29 08:49 /var/run/mysqld/mysqld.sock
Just make sure all socket settings are the same:
grep -r "socket.*=" /etc/mysql
Didn't mean that you should add any !includedir. Just that the path must
used when looking for settings. Had there been 2 includes, then the 2nd
could have settings that override those in the 1st.
Re: MythTV backend config problem.
Posted: Fri Jun 29, 2018 5:48 pm
by pinnerite
$ mysql -h 192.168.0.5 -u mythtv -pmythtv mythconverg
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.0.5' (111 "Connection refused")
thelma@origen ~ $ mysql -h 127.0.0.1 -u mythtv -pmythtv mythconverg
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused") BUT
thelma@origen ~ $ mysql -h localhost -u mythtv -pmythtv mythconverg
gets me to a prompt!
MariaDB [mythconverg]>
$ mysqld --version
Server version: 10.0.34-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
Regretfully, I am being summoned by she who must be obeyed.
I will try to follow up tomorrow. Thanks again.
Re: MythTV backend config problem.
Posted: Fri Jun 29, 2018 6:08 pm
by bill6502
Code: Select all
$ sudo grep -r "bind.address.*=" /etc/mysql
/etc/mysql/mariadb.conf.d/mysqld.cnf:bind-address = 127.0.0.1
/etc/mysql/mariadb.conf.d/50-server.cnf:bind-address = 127.0.0.1
/etc/mysql/mariadb.conf.d/mythtv.cnf:bind-address=::
I assume you restarted the server after changing the bind-address.
You needn't allow all IPv4 and IPv6 addresses like I do. And it sounds
like you have a different set of .cnf file, which is fine.
Re: MythTV backend config problem.
Posted: Thu Jul 05, 2018 3:55 pm
by pinnerite
I apologise for the delay in following up. Linux Mint issued a release (19) last weekend and it is an LTS release.
It made sense to install it over the 18.3 release and then press on.
The upgrade was successful in that I could now get into MariaDB but MythTV Backend Setup couldn't find the database.
Before I had a chance to investigate, the system went unstable. It has taken until now to get it back to a stable state.
I will have now have to run the basic tests before coming back again.
Re: MythTV backend config problem.
Posted: Fri Jul 06, 2018 11:18 am
by pinnerite
I managed to reach the stage of configuring the backend.
Upon exit two messages are returned:
1) GtkDialog mapped without a transient parent. This is discouraged. (?)
2) ERROR 2003 (HY000) Can't connect to MySQL server on '192.168.0.5' (111 "Connection refused!")
followed by:
./usr.bin/mythtv-setup: 42: /usr/bin/mythtv-setup: status: not found
Gtk-Message: 11:43:30:649: GtkDialog mapped without transient parent. Yjis is discouraged.
However, when I executed mythbackend from the $ prompt, I could then bring up the local frontend.
But when I tried to restore the mythconverg backup (below), it failed.
$ ./mythconverg_restore.pl --directory /home/mythbackup --filename mythconverg-2018.....3329.sql.gz
ERROR: Unable to do a full restore. The database contains data.
Re: MythTV backend config problem.
Posted: Fri Jul 06, 2018 12:28 pm
by MikeB2013
I am assuming Mint 19 (which based on Ubuntu Bionic) with myth 29 from Ubuntu Bionic repository.
"ERROR: Unable to do a full restore. The database contains data. " is due to the mythconverg database containing data. You need to add --drop_database --create_database to your command, I suggest you also add --verbose to the command (it provides more information on what is happening). Just to explain it a bit more, when mythtv is first installed it creates a blank database mythconverg, which is then populated when either mythtv-setup or mythbackend is run, you ran mythbackend and mythtv-setup. See
https://www.mythtv.org/wiki/Database_Backup_and_Restore
"1) GtkDialog mapped without a transient parent. This is discouraged. (?)
2) ERROR 2003 (HY000) Can't connect to MySQL server on '192.168.0.5' (111 "Connection refused!")
followed by:
./usr.bin/mythtv-setup: 42: /usr/bin/mythtv-setup: status: not found
Gtk-Message: 11:43:30:649: GtkDialog mapped without transient parent. Yjis is discouraged.
However, when I executed mythbackend from the $ prompt, I could then bring up the local frontend.."
At the present time, mythtv-setup and mythbackend should only controlled via a Terminal session:
sudo systemctl stop mythtv-backend #stops mythbackend process
sudo systemctl start mythtv-backend #starts mythbackend process
mythtv-setup must only be run after "sudo systemctl stop mythtv-backend"
You can check if mythbackend is running by "ps -A|grep my" in a terminal or "systemctl status mythtv-backend"
After using mythtv-setup run "sudo systemctl start mythtv-backend"
Running packaged mythbackend from a terminal is not recommended, it will run as the wrong user (packaged versions run with user mythtv)
Re: MythTV backend config problem.
Posted: Fri Jul 06, 2018 2:09 pm
by pinnerite
It didn't go as expected:
$ ./mythconverg_restore.pl --directory /home/mythbackup --filename mythconverg-20180626173329.sql.gz --drop_database -- create_database --verbose
returned:
The argument you supplied for the database information file is invalid.
If you were trying to specify a backup filename, please use the --directory
and --filename arguments.
ERROR: Invalid database information file, stopped at ./mythconverg_restore.pl line 710.
Re: MythTV backend config problem.
Posted: Fri Jul 06, 2018 2:21 pm
by MikeB2013
That might be because you have a space character between -- and create_database, it should be --create_database