<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 3:47 AM, Michael T. Dean <span dir="ltr"><<a href="mailto:mtdean@thirdcontact.com" target="_blank">mtdean@thirdcontact.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 01/25/2016 12:37 AM, David L wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
mythfilldatabase stopped working for me about a month ago. I get errors like this:<br>
016-01-24 21:18:01.068920 E  Error preparing query: DELETE FROM program WHERE starttime >= :FROM AND starttime < :TO AND chanid = :CHANID ;<br>
2016-01-24 21:18:01.068931 E  Driver error was [2/144]:<br>
QMYSQL3: Unable to prepare statement<br>
Database error was:<br>
Table './mythconverg/program' is marked as crashed and last (automatic?) repair failed<br>
<br>
2016-01-24 21:18:01.069814 E  Error preparing query: DELETE FROM program WHERE starttime >= :FROM AND starttime < :TO AND chanid = :CHANID ;<br>
<br>
I googled a bit and found some people that had similar problems.  I tried this recommended solution:<br>
<br>
mysqlcheck -r -umythtv -pxxxxxxxx mythconverg<br>
<br>
But that also gave me an error:<br>
<br>
mythconverg.program<br>
error    : Can't create new tempfile: './mythconverg/program.TMD'<br>
status   : Operation failed<br>
<br>
I have enough disk space, so that's not the problem.  I also found people with similar problems but didn't quite follow the solutions.  Any help would be appreciated.<br>
<br>
</blockquote>
<br></span>
The easiest approach--rather than dealing with mysqlcheck--and one that's better because it also performs some other useful maintenance is to run <a href="http://optimize_mythdb.pl" rel="noreferrer" target="_blank">optimize_mythdb.pl</a> .<br>
<br>
<a href="https://www.mythtv.org/wiki/User_Manual:Periodic_Maintenance#Optimize_the_Database" rel="noreferrer" target="_blank">https://www.mythtv.org/wiki/User_Manual:Periodic_Maintenance#Optimize_the_Database</a><br>
<br>
It should be on your system, somewhere, but you can always just download the script from:<br>
<br>
<a href="https://github.com/MythTV/mythtv/raw/master/mythtv/contrib/maintenance/optimize_mythdb.pl" rel="noreferrer" target="_blank">https://github.com/MythTV/mythtv/raw/master/mythtv/contrib/maintenance/optimize_mythdb.pl</a><br>
<br>
However, that will fail, too--for the same reason--until you fix the problem.  You seem to have specified a TEMP directory for MySQL (mysqld--not the mysqlcheck script) that's too small (or full). See:<br>
<br>
<a href="http://dev.mysql.com/doc/refman/5.7/en/temporary-files.html" rel="noreferrer" target="_blank">http://dev.mysql.com/doc/refman/5.7/en/temporary-files.html</a><br>
<br>
and fix the issue with your TEMP directory, and restart mysqld. Then, you can run <a href="http://optimize_mythdb.pl" rel="noreferrer" target="_blank">optimize_mythdb.pl</a> and things should be working fine.</blockquote><div><br></div><div><div><br></div><div>I have had mythtv installed on that backend for ~6 years and don't recall ever specifying a temp directory for MySQL.  I assume it's using whatever the default directory was configured when I originally installed it.  In any case, it doesn't look like any of my partitions are full.</div><div><br></div><div>udev            2.0G  4.0K  2.0G   1% /dev</div><div>tmpfs           404M  1.3M  402M   1% /run</div><div>/dev/sda1        92G   80G  7.7G  92% /</div><div>none            4.0K     0  4.0K   0% /sys/fs/cgroup</div><div>none            5.0M     0  5.0M   0% /run/lock</div><div>none            2.0G  246M  1.8G  13% /run/shm</div><div>none            100M   24K  100M   1% /run/user</div><div>/dev/sdb1       459G  413G   23G  95% /var/lib/mythtv</div><div>/dev/sdc1       1.8T  1.6T  163G  91% /sdc1</div><div>/dev/sda6       265G  229G   23G  91% /sda6</div><div>/dev/sda5       1.9G  518M  1.2G  30% /var/log</div></div><div><br></div><div>The repair program runs without any obvious errors:</div><div><br></div><div><div>Repaired/Optimized: `mythconverg`.`archiveitems`</div><div>Analyzed: `mythconverg`.`archiveitems`</div><div><snip>                                                                                     <br></div><div>Repaired/Optimized: `mythconverg`.`program`                                                                                      </div><div>Analyzed: `mythconverg`.`program`                                                                                                </div><div><snip></div><div>Repaired/Optimized: `mythconverg`.`websites`<br></div><div>Analyzed: `mythconverg`.`websites`</div></div><div><br></div><div>But it doesn't seem to fix anything.  Per your link to the temp dir configuration, I tried setting the TMPDIR environment variable to a partition with lots of free space:</div><div>sudo mkdir /sdc1/tmp<br></div><div>sudo chmod a+rwX /sdc1/tmp/<br></div><div>export TMPDIR=/sdc1/tmp/<br></div><div>df -h $TMPDIR<br></div><div><div>Filesystem      Size  Used Avail Use% Mounted on</div><div>/dev/sdc1       1.8T  1.6T  163G  91% /sdc1</div></div><div><br></div><div>I get the same error when running mysqlcheck and the optimizer still runs with no errors and doesn't fix the problem.</div><div><br></div><div><br></div></div></div></div>