![MythTV 无法连接到数据库](https://linux22.com/image/842315/MythTV%20%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%E6%95%B0%E6%8D%AE%E5%BA%93.png)
我是 Ubuntu 新手,刚刚从 iso(单个字体/后端组合)安装了 Mythbuntu 12.04.3(64 位)。似乎安装顺利,重新启动我的机器后才发现我面对的是一个要求输入国家和语言信息的屏幕(很好;英国,英语)。
但是,下一个屏幕显示“MythTV 无法连接到数据库”,并且我收到一个表单(两个表单之一),其中已经包含数据(主机名、密码……),因此无需更改任何内容。我单击下一步(进入两个屏幕中的第二个),再次不更改任何内容(两个复选框均未勾选),然后单击完成。这会将我带回到原始的国家/语言屏幕。
安装有问题吗?我是否遗漏了安装/说明中的某些内容?有办法修复此问题吗?
感谢您的回答。
答案1
编辑您的/etc/mysql/my.cnf
和/etc/mysql/conf.d/mythtv.cnf
文件,以便绑定地址是您的服务器地址(本地网络地址)而不是环回地址(127.0.0.1)。
重新启动后它应该会连接。如果您不确定密码是什么,nano /etc/mythtv/mysql.txt
--密码就在那里。
答案2
为了让 mythbackend 连接到 Ubuntu LTS 14.04.5 上的 mysql,我必须手动将设置更改/etc/mythtv/config.xml
为 MySQl 密码。 在我的情况下USER=mythtv | PASSWORD=mythtv
,按照 mythtv 的 GUI 设置屏幕,但这与 XML 文件中给出的默认值不匹配。
编辑后的情况如下:
<Configuration>
<Database>
<PingHost>1</PingHost>
<Host>localhost</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>
之后,从命令行手动调用 mythtv 后端(如下所示)似乎表明,至少 mythtv 可以成功连接到 MySQL:
# mythbackend
2017-02-25 12:41:15.716242 C mythbackend version: fixes/0.27 [v0.27-193-g8ee257c] www.mythtv.org
2017-02-25 12:41:15.716477 C Qt version: compile: 4.8.6, runtime: 4.8.6
2017-02-25 12:41:15.716485 N Enabled verbose msgs: general
2017-02-25 12:41:15.716511 N Setting Log Level to LOG_INFO
2017-02-25 12:41:15.728628 I Setup Interrupt handler
2017-02-25 12:41:15.728649 I Setup Terminated handler
2017-02-25 12:41:15.728666 I Setup Segmentation fault handler
2017-02-25 12:41:15.728683 I Setup Aborted handler
2017-02-25 12:41:15.728696 I Setup Bus error handler
2017-02-25 12:41:15.728711 I Setup Floating point exception handler
2017-02-25 12:41:15.728724 I Setup Illegal instruction handler
2017-02-25 12:41:15.728743 I Setup Real-time signal 0 handler
2017-02-25 12:41:15.728820 N Using runtime prefix = /usr
2017-02-25 12:41:15.728839 N Using configuration directory = /root/.mythtv
2017-02-25 12:41:15.728962 I Assumed character encoding: en_HK.UTF-8
2017-02-25 12:41:15.729455 N Empty LocalHostName.
2017-02-25 12:41:15.729471 I Using localhost value of silver
2017-02-25 12:41:15.734868 I Added logging to the console
2017-02-25 12:41:15.746596 N Setting QT default locale to en_HK
2017-02-25 12:41:15.746702 I Current locale en_HK
2017-02-25 12:41:15.746798 E No locale defaults file for en_HK, skipping
Table 'mythconverg.settings' doesn't exist
2017-02-25 12:41:15.751405 E Error preparing query: SELECT data FROM settings WHERE value = :VALUE AND hostname = :HOSTNAME
2017-02-25 12:41:15.751426 E Driver error was [2/1146]:
QMYSQL3: Unable to prepare statement
Database error was:
Table 'mythconverg.settings' doesn't exist
2017-02-25 12:41:15.752399 I No current database version?
2017-02-25 12:41:15.752931 I Database appears to be empty/new!
2017-02-25 12:41:15.752964 I The database seems to be empty - not attempting a backup
2017-02-25 12:41:15.784350 N Inserting MythTV initial database information.
2017-02-25 12:41:15.784401 C Upgrading to MythTV schema version 1307
2017-02-25 12:41:15.839389 I New Client: (#1)
2017-02-25 12:41:20.656220 C Upgrading to MythTV schema version 1308
2017-02-25 12:41:20.739196 C Upgrading to MythTV schema version 1309
2017-02-25 12:41:20.743457 C Upgrading to MythTV schema version 1310
2017-02-25 12:41:20.745158 C Upgrading to MythTV schema version 1311
2017-02-25 12:41:20.808532 C Upgrading to MythTV schema version 1312
2017-02-25 12:41:20.813258 C Upgrading to MythTV schema version 1313
2017-02-25 12:41:20.877572 C Upgrading to MythTV schema version 1314
2017-02-25 12:41:20.880266 C Upgrading to MythTV schema version 1315
2017-02-25 12:41:20.881536 C Upgrading to MythTV schema version 1316
2017-02-25 12:41:21.006324 C Upgrading to MythTV schema version 1317
No setting found for this machine's BackendServerIP.
Please run setup on this machine and modify the first page
of the general settings.
2017-02-25 12:41:21.502112 I Database schema upgrade complete.
2017-02-25 12:41:21.504143 I Loading en_us translation for module mythfrontend
答案3
我遇到过同样的问题,而我找到的唯一解决方案就是安装 mythbuntu。似乎有某种神秘的 mythtv 教派,需要魔法解码环或特殊握手之类的东西才能给出这个经常被问到的问题的答案。我有一个 mythbuntu 安装正在运行,它确实可以工作,但我从未能够让 mythtv 在现有桌面上运行。