(2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

jjthomas
Junior
Posts: 58
Joined: Sun Jul 19, 2015 11:53 am
United States of America

(2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by jjthomas »

Welcome to 2018?

I am running MythTV on Centos 7.4.1708, a fresh installation. I installed MythTV using the @nux-destop.

I'm able to connect to the MythTV database via the command line. I have one config.xml which is linked to /etc/mythtv/config.xml. I've googled, searched and I find multiple instances of this error, but none of the solutions work. In the past, I've been able to get this to work by beating solution into the keyboard, until it works. I would prefer to come up with a concrete solution. A solution that puts this error to rest, once and for all.

I have done multiple installations of MythTV and I always run into this error. Be it FreeBSD, Slackware, ubuntu, Debian, Fedora and now CentOS.

All I get from the logs is:

Code: Select all

2018-01-15 02:02:55.803185 E [2842/2842] CoreContext mythdbcon.cpp:242 (OpenDatabase) - [DBManager0] Unable to connect to database!
2018-01-15 02:02:55.803251 E [2842/2842] CoreContext mythdbcon.cpp:243 (OpenDatabase) - Driver error was [1/1045]:
QMYSQL: Unable to connect
Database error was:
Access denied for user 'mythtv'@'localhost' (using password: YES)
My config.xml:

Code: Select all

[jjthomas@anthem ~]$ cat /etc/mythtv/config.xml 
<Configuration>
  <LocalHostName>my-unique-identifier-goes-here</LocalHostName>
  <Database>
    <PingHost>1</PingHost>
    <Host>anthem.027esc.net</Host>
    <UserName>mythtv</UserName>
    <Password>AWvsUQbN7a85SjK2</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>
Find config.xml:

Code: Select all

[root@anthem ~]# find / -name 'config.xml'
/etc/mythtv/config.xml
/home/jjthomas/.mythtv/config.xml

[root@anthem ~]# ls -l /etc/mythtv/config.xml 
lrwxrwxrwx. 1 root root 33 Jan 15 01:31 /etc/mythtv/config.xml -> /home/jjthomas/.mythtv/config.xml
Connecting to MySQL (MariaDB), directly

Code: Select all

[root@anthem ~]# mysql -u mythtv -pAWvsUQbN7a85SjK2
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> exit
Bye
By all rights, this should work.

Help?

TIA

-JJ
PhilB
Senior
Posts: 403
Joined: Sun May 11, 2014 6:23 pm
Great Britain

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by PhilB »

This may be at a slight tangent but a common pitfall is that a normal combined frontend/backend installation needs two copies of that file:
One for the backend running under user mythtv placed in /home/mythtv/.mythtv/config.xml
One for the frontend running under <you> placed in /home/<you>/.mythtv/config.xml
One or other of them may be a link to /etc/mythtv/config.xml

For the frontend to work it needs a valid config.xml.
Regards
Phil
jjthomas
Junior
Posts: 58
Joined: Sun Jul 19, 2015 11:53 am
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by jjthomas »

Hello,

I added .mythtv/config.xml to every directory I could think of. Still not working.

Here are my locations of the file config.xml, all the files are identical:

Code: Select all

[root@anthem .mythtv]# find / -iname "config.xml"
/usr/share/doc/mythtv-docs-29.0/contrib/config_files/config.xml
/etc/mythtv/config.xml
/root/.mythtv/config.xml
/var/lib/mythtv/.mythtv/config.xml
/home/mythtv/.mythtv/config.xml
/home/jjthomas/.mythtv/config.xml
MythTV user:

Code: Select all

mythtv:x:989:981:mythbackend user:/var/lib/mythtv:/sbin/nologin
I went a little further in to the logs and found that MythTV complains that is cannot find the host name:

Code: Select all

2018-01-15 10:58:04.554092 E [16660/16660] CoreContext mythdbparams.cpp:39 (IsValid) - DBHostName is not set in config.xml
2018-01-15 10:58:04.554126 E [16660/16660] CoreContext mythdbparams.cpp:39 (IsValid) - DBHostName is not set in config.xml
2018-01-15 10:58:04.554174 N [16660/16660] CoreContext mythcontext.cpp:599 (LoadDatabaseSettings) - Empty LocalHostName.
2018-01-15 10:58:04.554189 I [16660/16660] CoreContext mythcontext.cpp:607 (LoadDatabaseSettings) - Using localhost value of anthem.027esc.net
2018-01-15 10:58:04.554307 I [16660/16660] CoreContext mythcontext.cpp:849 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 0, status dbAwake
2018-01-15 10:58:04.656580 I [16660/16670] LogForward loggingserver.cpp:146 (FileLogger) - Added logging to /var/log/mythtv/mythbackend.20180115185804.16660.log
2018-01-15 10:58:05.579113 E [16660/16660] CoreContext mythdbcon.cpp:242 (OpenDatabase) - [DBManager0] Unable to connect to database!
2018-01-15 10:58:05.579188 E [16660/16660] CoreContext mythdbcon.cpp:243 (OpenDatabase) - Driver error was [1/1045]:
QMYSQL: Unable to connect
Database error was:
Access denied for user 'mythtv'@'localhost' (using password: YES)
Access to the database from the command line works just fine:

Code: Select all

mysql -u mythtv -h anthem.027esc.net -pAWvsUQbN7a85SjK2 
I forgot to add that I am running MythTV version 29.
uname -a:Linux anthem.027esc.net 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Is there a way to find out, for sure, where MythTV is looking for config.xml. Would it help to add my hostname somewhere?

-JJ
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by bill6502 »

Hi,

Look for a line similar to this in your logs (both frontend and backend will
have it.):

Code: Select all

2018-01-12 11:08:10.785157 N [2335/2335] thread_unknown mythdirs.cpp:205 (InitializeMythDirs) - Using configuration directory = /home/mythtv/.mythtv
Also, this Wiki: https://www.mythtv.org/wiki/Config.xml#Troubleshooting
jjthomas
Junior
Posts: 58
Joined: Sun Jul 19, 2015 11:53 am
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by jjthomas »

I see Read conf dir = /etc/mythtv Using configuration directory = /etc/mythtv

For grins and giggles I put config.xml in /etc/mtyhtv/.mythtv. No help.

Code: Select all

[root@anthem ~]# grep -rnw '/var/log/mythtv/' -e mythdirs
/var/log/mythtv/mythbackend.20180115183154.14873.log:15:2018-01-15 10:31:54.282683 N [14873/14873] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115183154.14873.log:16:2018-01-15 10:31:54.282741 N [14873/14873] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115183154.14873.log:17:2018-01-15 10:31:54.282746 N [14873/14873] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115093429.13010.log:15:2018-01-15 01:34:29.513314 N [13010/13010] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115093429.13010.log:16:2018-01-15 01:34:29.513379 N [13010/13010] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115093429.13010.log:17:2018-01-15 01:34:29.513385 N [13010/13010] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115185804.16660.log:15:2018-01-15 10:58:04.553187 N [16660/16660] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115185804.16660.log:16:2018-01-15 10:58:04.553258 N [16660/16660] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115185804.16660.log:17:2018-01-15 10:58:04.553263 N [16660/16660] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115184113.15487.log:15:2018-01-15 10:41:13.264492 N [15487/15487] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115184113.15487.log:16:2018-01-15 10:41:13.264548 N [15487/15487] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115184113.15487.log:17:2018-01-15 10:41:13.264553 N [15487/15487] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115105415.5109.log:15:2018-01-15 02:54:15.351469 N [5109/5109] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115105415.5109.log:16:2018-01-15 02:54:15.351539 N [5109/5109] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115105415.5109.log:17:2018-01-15 02:54:15.351544 N [5109/5109] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115100254.2842.log:15:2018-01-15 02:02:54.759882 N [2842/2842] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115100254.2842.log:16:2018-01-15 02:02:54.759946 N [2842/2842] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115100254.2842.log:17:2018-01-15 02:02:54.759951 N [2842/2842] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115093423.12981.log:15:2018-01-15 01:34:23.924118 N [12981/12981] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115093423.12981.log:16:2018-01-15 01:34:23.924173 N [12981/12981] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115093423.12981.log:17:2018-01-15 01:34:23.924177 N [12981/12981] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115093153.12870.log:15:2018-01-15 01:31:53.241334 N [12870/12870] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115093153.12870.log:16:2018-01-15 01:31:53.241389 N [12870/12870] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115093153.12870.log:17:2018-01-15 01:31:53.241393 N [12870/12870] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115094727.13489.log:15:2018-01-15 01:47:27.897006 N [13489/13489] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115094727.13489.log:16:2018-01-15 01:47:27.897062 N [13489/13489] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115094727.13489.log:17:2018-01-15 01:47:27.897066 N [13489/13489] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115182932.14689.log:15:2018-01-15 10:29:32.520592 N [14689/14689] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115182932.14689.log:16:2018-01-15 10:29:32.520654 N [14689/14689] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115182932.14689.log:17:2018-01-15 10:29:32.520658 N [14689/14689] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115093503.13033.log:15:2018-01-15 01:35:03.180615 N [13033/13033] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115093503.13033.log:16:2018-01-15 01:35:03.180679 N [13033/13033] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115093503.13033.log:17:2018-01-15 01:35:03.180685 N [13033/13033] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115092935.12783.log:15:2018-01-15 01:29:35.055930 N [12783/12783] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115092935.12783.log:16:2018-01-15 01:29:35.055991 N [12783/12783] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115092935.12783.log:17:2018-01-15 01:29:35.055995 N [12783/12783] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
/var/log/mythtv/mythbackend.20180115104656.4630.log:15:2018-01-15 02:46:56.673087 N [4630/4630] thread_unknown mythdirs.cpp:33 (InitializeMythDirs) - Read conf dir = /etc/mythtv
/var/log/mythtv/mythbackend.20180115104656.4630.log:16:2018-01-15 02:46:56.673178 N [4630/4630] thread_unknown mythdirs.cpp:195 (InitializeMythDirs) - Using runtime prefix = /usr
/var/log/mythtv/mythbackend.20180115104656.4630.log:17:2018-01-15 02:46:56.673185 N [4630/4630] thread_unknown mythdirs.cpp:197 (InitializeMythDirs) - Using configuration directory = /etc/mythtv
jjthomas
Junior
Posts: 58
Joined: Sun Jul 19, 2015 11:53 am
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by jjthomas »

I took a look at https://www.mythtv.org/wiki/Config.xml#Troubleshooting , everything seems to be okay.

Relevant information in /usr/lib/systemd/system/mythbackend.service:

Code: Select all

[root@anthem ~]# grep -v '^#' /usr/lib/systemd/system/mythbackend.service
[Unit]
Description=MythTV backend service
After=network-online.target mariadb.service mysqld.service time-sync.target

[Service]
Type=simple
Environment=MYTHCONFDIR=/etc/mythtv
User=mythtv
ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv

[Install]
WantedBy=multi-user.target
I've never debugged a program, but if you can give me instructions, I'll give it a shot.

BTW running /usr/bin/mythbackend as root works fine. and when
I gave mythtv a login script /bin/bash and it runs fine as mythtv user

Thank you for helping, i really want to get this working.

-JJ
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by bill6502 »

.mythtv is the configuration directory typically used in ~mythtv or ~.
Your system is using /etc/mythtv, so put config.xml directly under
it.

Note the line in the backend service file: Environment=MYTHCONFDIR=/etc/mythtv,
that's why /etc/mythtv is showing up in the log.
jjthomas
Junior
Posts: 58
Joined: Sun Jul 19, 2015 11:53 am
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by jjthomas »

It is, I went ahead and copied my users config.xml to /etc/mythtv.

Code: Select all

[root@anthem ~]# ls -l /etc/mythtv
total 4
-rw-r--r--. 1 root root 645 Jan 15 17:35 config.xml

Code: Select all

<Configuration>
  <LocalHostName>my-unique-identifier-goes-here</LocalHostName>
  <Database>
    <PingHost>1</PingHost>
    <Host>anthem.027esc.net</Host>
    <UserName>mythtv</UserName>
    <Password>AWvsUQbN7a85SjK2</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>
  <UPnP>
    <UDN>
      <MediaRenderer>8c8ef326-27be-48e4-90a8-cfde98d1131e</MediaRenderer>
    </UDN>
  </UPnP>
</Configuration>
and crap now it works...
jjthomas
Junior
Posts: 58
Joined: Sun Jul 19, 2015 11:53 am
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by jjthomas »

Okay, here is what I found:

MythTV does not follow the link from /etc/mythtv to /home/jjthomas/.mythtv/config.xml
The solution is to copy the file directly to /etc/mythtv/config.xml

It seemed that things changed when i changed /etc/passwd for the mythtv user from /sbin/nologin to /bin/bash
I also added config.xml to /var/lib/mythtv/.mythtv I have since change the /etc/passwd back to /sbin/nologin and
removed /var/lib/mythtv/.mythtv/config.xml.

And I had to make sure mythbackend starts at bootup via: systemctl enable mythbackend.service
and I had to turn off the firewall. I'm using a HDHomeRun tuner.

I hope this will help the next person,or myself when I have to reinstall. :)

Thank you for the help. And thank you for all your work on MythTV.

-JJ
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by bill6502 »

To be clear, the Environment=MYTHCONFDIR=/etc/mythtv line in the
backend service is pointing directly to /etc/mythtv. The HOME directory
developed from the mythtv user isn't in play as MYTHCONFIDIR overrides
it.
vidtek
Junior
Posts: 73
Joined: Wed Aug 05, 2015 4:47 pm
Great Britain

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by vidtek »

The service name has variants, if this: systemctl enable mythbackend.service
doesn't work use this: systemctl enable mythtv-backend.service

Tony
Myth.32 Krnl. 5.15.0-73 QT5.15.2 ubntu 22.04.1 Intel i7-7700K GTX 1660 Nvdia Hauppge Quad tunerT2 HomerundualT1
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by bill6502 »

systemctl list-units | grep myth

or systemctl status myth<then the tab key>

Will help.
jjthomas
Junior
Posts: 58
Joined: Sun Jul 19, 2015 11:53 am
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by jjthomas »

Hello, I ran into this again. It turns out MythTV does not follow symbolic links.
I did not know if I should start a new thread, or if you just want to mark this one solved.

I hope this will help the next person. :)

I had

Code: Select all

[root@anthem mythtv]# pwd
/etc/mythtv
ls -Fla
lrwxrwxrwx. 1 root root 33 Feb  1 16:32 config.xml -> /home/jjthomas/.mythtv/config.xml
I deleted the link and simply copied the file over to /etc/mythtv

The error I initially received was:

Code: Select all

[root@anthem ~]# systemctl status mythbackend.service 
● mythbackend.service - MythTV backend service
   Loaded: loaded (/usr/lib/systemd/system/mythbackend.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2020-02-01 22:51:25 PST; 22s ago
  Process: 6724 ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv (code=exited, status=130)
 Main PID: 6724 (code=exited, status=130)

Feb 01 22:51:22 anthem.027esc.net mythbackend[6724]: 2020-02-01 22:51:22.719635 I  UPNP Search 1 secs
Feb 01 22:51:24 anthem.027esc.net mythbackend[6724]: 2020-02-01 22:51:24.091284 I  No UPnP backends found
Feb 01 22:51:25 anthem.027esc.net mythbackend[6724]: No UPnP backends found
Feb 01 22:51:25 anthem.027esc.net mythbackend[6724]: Would you like to configure the database connection now? [no]
Feb 01 22:51:25 anthem.027esc.net mythbackend[6724]: [console is not interactive, using default 'no']
Feb 01 22:51:25 anthem.027esc.net mythbackend[6724]: 2020-02-01 22:51:25.091661 C  Failed to init MythContext.
Feb 01 22:51:25 anthem.027esc.net mythbackend[6724]: 2020-02-01 22:51:25.629465 I  Removed logging to /var/log/mythtv/mythbackend.20200202065119.6724.log
Feb 01 22:51:25 anthem.027esc.net systemd[1]: mythbackend.service: main process exited, code=exited, status=130/n/a
Feb 01 22:51:25 anthem.027esc.net systemd[1]: Unit mythbackend.service entered failed state.
Feb 01 22:51:25 anthem.027esc.net systemd[1]: mythbackend.service failed.
FWIW I was able to log in to MySQL using the values in config.xml

Code: Select all

[root@anthem mythtv]# cat /etc/mythtv/config.xml 
<Configuration>
  <LocalHostName>my-unique-identifier-goes-here</LocalHostName>
  <Database>
    <PingHost>1</PingHost>
    <Host>localhost</Host>
    <UserName>mythtv</UserName>
    <Password>VuXoSCKS2bxYctaw2</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>
  <UPnP>
    <UDN>
      <MediaRenderer>c60c3f79-03d1-4a14-a300-7b808305dc97</MediaRenderer>
    </UDN>
  </UPnP>
</Configuration>
[root@anthem mythtv]#
[root@anthem mythtv]#  mysql -u mythtv -h localhost -pVuXoSCKS2bxYctaw2 mythconverg
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 87
Server version: 5.5.64-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [mythconverg]> exit
Bye
[root@anthem mythtv]# 
Again, after I removed the link and just copied the file over, it worked.

-Julian
User avatar
bill6502
Developer
Posts: 2307
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by bill6502 »

systemd probably isn't following the symbolic link, by design. Most likely a security thing.

You've chosen the solution that has a single config.xml file in /etc/mythtv. That's a good choice.
Your own user should link to that file, as the Wiki says. Linking from /etc/mythtv to user files has
never been suggested. You don't have to link from /home/jjthomas/.mythtv/config.xml, it can be
a copy of the version in /etc/mythtv. But then you must update both if changes are made.
valliant
Newcomer
Posts: 1
Joined: Tue Feb 23, 2021 6:21 am
United States of America

Re: (2018) Access denied for user 'mythtv'@'localhost' (using password: YES)

Post by valliant »

I was getting an error saying that mythtv couldn't connect to the database.

After viewing the logs, I decided that it was similar to the problem in this thread. For me, the problem started after I ran mythfrontend as the user named mythtv. In other words I ran the front end as the same user that runs the backend.

I suspect that running the frontend as mythtv caused the system to overwrite the following file:
/home/mythtv/.mythtv/config.xml

I compared the file /home/mythtv/.mythtv/config.xml to /etc/mythtv/config.xml I noticed that the one in the /etc directory had an older date and the one in /home/mythtv/.mythtv had a very modification recent date.

Thanks to the post, I resolved the issue by doing the following two things:
1. backup of /home/mythtv/.mythtv/config.xml -- just in case
2. cp /etc/mythtv/config.xml /home/mythtv/.mythtv/config.xml
Post Reply