[mythtv-users] Mythfrontend on Android-database access

Stephen Worthington stephen_agent at jsw.gen.nz
Mon May 16 17:13:26 UTC 2022


On Mon, 16 May 2022 09:41:38 -0500, you wrote:

>Hmm, I don't recall creating users or grants, so assumed it was done for 
>me on another step of the install.

When you install a clean system and it creates a new mythconverg
database, that is done with this file:

/usr/share/mythtv/sql/mc.sql

root at mypvr:/usr/share/mythtv/sql# cat mc.sql
CREATE DATABASE IF NOT EXISTS mythconverg;
CREATE USER IF NOT EXISTS 'mythtv'@'localhost' IDENTIFIED WITH
mysql_native_password;
ALTER USER 'mythtv'@'localhost' IDENTIFIED BY 'mythtv';
GRANT ALL ON mythconverg.* TO mythtv at localhost;
FLUSH PRIVILEGES;
GRANT CREATE TEMPORARY TABLES ON mythconverg.* TO mythtv at localhost;
FLUSH PRIVILEGES;
ALTER DATABASE mythconverg DEFAULT CHARACTER SET utf8 COLLATE
utf8_general_ci;

So it sets up the mythtv at localhost user to match the default
/etc/mythtv/config.xml file.

> I used this to load the previous 
>database:
>
>sudo /usr/share/mythtv/mythconverg_restore.pl --drop_database 
>--create_database --filename 
>/home/mythtv/db_backups/mythconverg-1350-20220501093643.sql.gz
>
>Then adjusted config.xml to use the default password.
>
>Anyway, I found a workaround for the mysql "identified by" issue here:
>
>https://stackoverflow.com/questions/5555328/error-1396-hy000-operation-create-user-failed-for-jacklocalhost
>
>And tried:
>
>mysql> drop user mythtv@'%';
>mysql> flush privileges;
>mysql> create user mythtv@'%' identified by 'mythtv';
>mysql> flush privileges;
>mysql> show grants for mythtv;
>
>+------------------------------------+
>| Grants for mythtv@%                |
>+------------------------------------+
>| GRANT USAGE ON *.* TO `mythtv`@`%` |
>+------------------------------------+
>1 row in set (0.00 sec)
>
>mysql> grant all privileges on mythconverg.* to 'mythtv'@'%';
>mysql> show grants for mythtv;
>
>+---------------------------------------------------------+
>| Grants for mythtv@%                                     |
>+---------------------------------------------------------+
>| GRANT USAGE ON *.* TO `mythtv`@`%`                      |
>| GRANT ALL PRIVILEGES ON `mythconverg`.* TO `mythtv`@`%` |
>+---------------------------------------------------------+
>2 rows in set (0.01 sec)
>
>The local fe/be still works and now the ubuntu 18.04 box (johnny) has 
>access.  But the ONN still has the same problem.  By the way, I turned 
>off the V-32 backend and turned on the ubuntu 18.04 backend (on 
>johnny).  ONN found it and asked to update the database, so I assume it 
>was able to connect the it's mysql server.  I'll  check for differences 
>between them.
>
>Don


More information about the mythtv-users mailing list