<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 11/21/2019 1:04 PM, Greg Oliver
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAF4tN+9RZzPXZdtBjy8aT=tCuACgtph5nAQfaJ=VuCCK_JPgBQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">On Thu, Nov 21, 2019 at 11:24 AM Don Brett <<a
          href="mailto:dlbrett@zoominternet.net" moz-do-not-send="true">dlbrett@zoominternet.net</a>>
        wrote:<br>
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">On 11/21/2019 3:32 AM,
            Stephen Worthington wrote:<br>
            > On Wed, 20 Nov 2019 23:01:50 -0500, you wrote:<br>
            ><br>
            >> I had a working 18.04 Ubuntu-Mate box that worked
            fine; after a<br>
            >> self-induced catastrophic error, I ended up
            rebuilding it (fe/be box<br>
            >> with one remote frontend).  The rebuild also works
            pretty well, but I<br>
            >> haven't gotten the remote front-end working yet.  I
            haven't made any<br>
            >> changes to the remote, but I'm getting database
            connection errors.<br>
            >> Tried lots of things, but no luck.  Any suggestions
            on what to look for?<br>
            >><br>
            >> Don<br>
            >><br>
            >> *From the logs:*<br>
            >><br>
            >> *Excerpts from remote box:
            (/var/log/mythtv/mythfrontend.log)*<br>
            >> Nov 20 12:49:34 jax mythfrontend.real:
            mythfrontend[2459]: E CoreContext<br>
            >> mythdbcon.cpp:239 (OpenDatabase) Driver error was
            [1/1045]:#012QMYSQL:<br>
            >> Unable to connect#012Database error was:#012Access
            denied for user<br>
            >> 'mythtv'@'jax' (using password: YES)<br>
            >><br>
            >> Nov 20 12:49:34 jax mythfrontend.real:
            mythfrontend[2459]: E CoreContext<br>
            >> mythdb.cpp:646 (GetSettingOnHost) Database not open
            while trying to load<br>
            >> setting: backendserverport<br>
            >><br>
            >> *Excerpts from fe/be
            box:**(/var/log/mysql/error.log)*<br>
            >> 2019-11-20T17:49:34.057263Z 544 [Note] Access
            denied for user<br>
            >> 'mythtv'@'jax' (using password: YES)<br>
            >> 2019-11-20T18:00:01.606694Z 545 [Note] Got an error
            reading<br>
            >> communication packets<br>
            >> 2019-11-21T00:01:41.387690Z 721 [Note] Got an error
            reading<br>
            >> communication packets<br>
            >> 2019-11-21T00:15:52.630339Z 156 [Note] Aborted
            connection 156 to db:<br>
            >> 'mythconverg' user: 'mythtv' host: 'localhost' (Got
            timeout reading<br>
            >> communication packets)<br>
            >><br>
            >><br>
            >> *Things I've checked:**<br>
            >> **<br>
            >> **/home/don/don.my.cnf*<br>
            >> secure_file_priv=/var/lib/mysql<br>
            >><br>
            >> */home/don/.mythtv/config.xml (same as it was
            before rebuild)*<br>
            >>
<LocalHostName>my-unique-identifier-goes-here</LocalHostName><br>
            >>    <Database><br>
            >>      <PingHost>1</PingHost><br>
            >>      <Host>localhost</Host><br>
            >>      <UserName>mythtv</UserName><br>
            >>      <Password>mythtv</Password><br>
            >>     
            <DatabaseName>mythconverg</DatabaseName><br>
            >>      <Port>3306</Port><br>
            >>    </Database><br>
            >><br>
            >> */home/mythtv/.mythtv/config.xml (symlinked to
            /etc/mythtv/config.xml)*<br>
            >> <Configuration><br>
            >>    <Database><br>
            >>      <PingHost>1</PingHost><br>
            >>      <Host>localhost</Host><br>
            >>      <UserName>mythtv</UserName><br>
            >>      <Password>mythtv</Password><br>
            >>     
            <DatabaseName>mythconverg</DatabaseName><br>
            >>      <Port>3306</Port><br>
            >>    </Database><br>
            >><br>
            >> */etc/mysql/mysql.conf.d/mysqld.cnf*<br>
            >> # removed 11/17/2019<br>
            >> #bind-address           = 127.0.0.1<br>
            >><br>
            >> # trying this 11/18/2019...didn't help<br>
            >> #bind-address           = 0.0.0.0<br>
            >><br>
            >> */etc/mysql/mysql.conf.d/mythtv.cnf*<br>
            >> [mysqld]<br>
            >> #bind-address=::<br>
            >> max_connections=100<br>
            >> #sql_mode=NO_ENGINE_SUBSTITUTION<br>
            > If you are doing external access to the database, you
            do need either<br>
            > "bind-address = 0.0.0.0" or "bind-address=::".  Use ::
            if you want<br>
            > IPv6 to work.  Make sure that all other "bind-address="
            lines in all<br>
            > the MySQL/MariaDB config files are commented out.  You
            need to restart<br>
            > MySQL or MariaDB before it will see the change:<br>
            ><br>
            > sudo systemctl restart mysql<br>
            >   or<br>
            > sudo systemctl restart mariadb<br>
            ><br>
            > However, the first error message you are reporting is
            "Access denied".<br>
            > So that may mean that you have not done the right GRANT
            command to<br>
            > allow that user access from that location.  I think
            doing this on the<br>
            > backend PC should fix that problem:<br>
            ><br>
            > sudo mysql<br>
            > GRANT ALL PRIVILEGES ON mythconverg to 'mythtv'@'jax';<br>
            > FLUSH PRIVILEGES;<br>
            > exit<br>
          </blockquote>
          <div><br>
          </div>
          <div style="font-family:monospace,monospace"
            class="gmail_default">Should be :</div>
          <div style="font-family:monospace,monospace"
            class="gmail_default"><br>
          </div>
          <div style="font-family:monospace,monospace"
            class="gmail_default">GRANT ALL PRIVILEGES ON mythconverg.*
            to 'mythtv'@'jax';</div>
          <div> </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            > If that does not work, or you want to allow access from
            all devices on<br>
            > your network, try:<br>
            ><br>
            > sudo mysql<br>
            > GRANT ALL PRIVILEGES ON mythconverg to 'mythtv'@'%';<br>
            > FLUSH PRIVILEGES;<br>
            > exit<br>
            ><br>
            > The above presumes that you have actually created the
            user 'mythtv'.<br>
            > If not, then you may need to do the following before
            the above GRANT<br>
            > commands:<br>
            ><br>
            > GRANT ALL PRIVILEGES ON mythconverg TO
            'mythtv'@'localhost' IDENTIFIED<br>
            > BY 'mythtv' WITH GRANT OPTION;<br>
            ><br>
            > Then you need to make sure the config.xml file being
            used by the<br>
            > remote frontend has its <Host></Host> value
            set to the IP address or<br>
            > hostname of the backend PC.  Both the config.xml files
            you posted have<br>
            > it set to "localhost", which will not work for a remote
            frontend.<br>
            ><br>
            > Once you have database access working, you also need to
            ensure that<br>
            > mythbackend only starts after the network is fully up. 
            The default<br>
            > systemd file for mythbackend only waits for localhost
            to be up, and<br>
            > mythbackend then never binds to the external IP
            address.  If that is<br>
            > the case, just restarting mythbackend after booting is
            complete will<br>
            > fix that until the next reboot:<br>
            ><br>
            > sudo systemctl restart mythtv-backend<br>
            ><br>
            > If the above fixes things, then you need to create an
            appropriate<br>
            > systemd override file for mythbackend.  There are other
            threads on<br>
            > this mailing list about how to do that - it is modestly
            complicated so<br>
            > I do not want to repeat it here again unless you can
            not find the<br>
            > proper thread.  A google search for
            "wait-until-pingable.py" (in<br>
            > double quotes) should find it.<br>
            > _______________________________________________<br>
            > mythtv-users mailing list<br>
            > <a href="mailto:mythtv-users@mythtv.org"
              target="_blank" moz-do-not-send="true">mythtv-users@mythtv.org</a><br>
            > <a
              href="http://lists.mythtv.org/mailman/listinfo/mythtv-users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a><br>
            > <a
              href="http://wiki.mythtv.org/Mailing_List_etiquette"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://wiki.mythtv.org/Mailing_List_etiquette</a><br>
            > MythTV Forums: <a href="https://forum.mythtv.org"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://forum.mythtv.org</a><br>
            <br>
            Did the changes for bind-address=::, no difference.  Tried
            granting <br>
            privileges and got:<br>
            <br>
            mysql> GRANT ALL PRIVILEGES ON mythconverg to
            'mythtv'@'jax';<br>
            ERROR 1046 (3D000): No database selected<br>
            mysql><br>
            mysql> use mysql;<br>
            Reading table information for completion of table and column
            names<br>
            You can turn off this feature to get a quicker startup with
            -A<br>
            <br>
            Database changed<br>
            mysql> GRANT ALL PRIVILEGES ON mythconverg to
            'mythtv'@'jax';<br>
            ERROR 1133 (42000): Can't find any matching row in the user
            table<br>
            mysql><br>
            mysql> GRANT ALL PRIVILEGES ON mythconverg TO
            'mythtv'@'localhost' <br>
            IDENTIFIED<br>
                 -> BY 'mythtv' WITH GRANT OPTION;<br>
            Query OK, 0 rows affected, 1 warning (0.00 sec)<br>
            mysql><br>
            mysql> GRANT ALL PRIVILEGES ON mythconverg to
            'mythtv'@'%';<br>
            Query OK, 0 rows affected (0.00 sec)<br>
            <br>
            Then rebooted, still no difference.<br>
            <br>
            Did I use the correct database?<br>
            <br>
            Checked /etc/mythtv/config.xml on the remote, it was using
            localhost, so <br>
            changed to 192.168.0.177 (backend address).  No difference.<br>
            <br>
            During the rebuild, I used your systemd procedure, so <br>
            "wait-until-pingable.py" was already in place.<br>
            <br>
            <br>
            Still getting access denied messages from mysql:<br>
            <br>
            *From /var/log/mysql/error.log (on backend)*<br>
            2019-11-21T16:46:18.681726Z 525 [Note] Access denied for
            user <br>
            'mythtv'@'jax' (using password: YES)<br>
            <br>
            <br>
            By the way, should this be working?  It's from the remote
            box to the <br>
            backend box.<br>
            <br>
            don@jax:~$ sudo mysql -h192.168.0.177 -umythtv -p<br>
            Enter password:<br>
            ERROR 1045 (28000): Access denied for user 'mythtv'@'jax'
            (using <br>
            password: YES)<br>
            <br>
            <br>
            Don<br>
            <br>
            _______________________________________________<br>
            mythtv-users mailing list<br>
            <a href="mailto:mythtv-users@mythtv.org" target="_blank"
              moz-do-not-send="true">mythtv-users@mythtv.org</a><br>
            <a
              href="http://lists.mythtv.org/mailman/listinfo/mythtv-users"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a><br>
            <a href="http://wiki.mythtv.org/Mailing_List_etiquette"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://wiki.mythtv.org/Mailing_List_etiquette</a><br>
            MythTV Forums: <a href="https://forum.mythtv.org"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://forum.mythtv.org</a><br>
          </blockquote>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
mythtv-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a>
<a class="moz-txt-link-freetext" href="http://lists.mythtv.org/mailman/listinfo/mythtv-users">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a>
<a class="moz-txt-link-freetext" href="http://wiki.mythtv.org/Mailing_List_etiquette">http://wiki.mythtv.org/Mailing_List_etiquette</a>
MythTV Forums: <a class="moz-txt-link-freetext" href="https://forum.mythtv.org">https://forum.mythtv.org</a>
</pre>
    </blockquote>
    <br>
    Am I using the correct database?<br>
    <br>
    mysql> use mysql;<br>
    Database changed<br>
    mysql> GRANT ALL PRIVILEGES ON mythconverg.* to 'mythtv'@'jax';<br>
    ERROR 1133 (42000): Can't find any matching row in the user table<br>
    mysql><br>
    mysql> select user, host from user;<br>
    +------------------+-----------+<br>
    | user             | host      |<br>
    +------------------+-----------+<br>
    | mythtv           | %         |<br>
    | debian-sys-maint | localhost |<br>
    | mysql.session    | localhost |<br>
    | mysql.sys        | localhost |<br>
    | mythtv           | localhost |<br>
    | root             | localhost |<br>
    +------------------+-----------+<br>
    6 rows in set (0.00 sec)<br>
    <br>
    <br>
  </body>
</html>