<div class="gmail_quote">On Sat, Nov 5, 2011 at 9:09 AM, Robert Longbottom <span dir="ltr">&lt;<a href="mailto:rongblor@googlemail.com">rongblor@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On 05/11/2011 11:45, Damian wrote:<br>
&gt; :-) Thanks Geoff, Bill and John for helping out.<br>
<br>
</div>I&#39;ll start by saying I&#39;ve not been following this, but here goes with a<br>
few suggestions...<br>
<div class="im"><br>
&gt; Here&#39;s the latest. I&#39;ve done a lot, and think I&#39;ve got enough to clarify<br>
&gt; the problem a bit to &#39;those of you who know&#39;, but I&#39;m at the edge of my<br>
&gt; understanding again. Here&#39;s where it&#39;s at ....<br>
&gt;<br>
&gt; Both mysql.txt and config.xml contain &#39;192.168.0.2&#39; rather than<br>
&gt; &#39;MythBox&#39;, but I think I need to fix my bigger problems with mysql<br>
&gt; before I start messing with the MythTV setup. I can&#39;t currently log into<br>
&gt; mysql as root, so trying to fix anything further down the line seems futile.<br>
&gt;<br>
&gt; I did run:<br>
&gt; /var/run$ chown -R mysql:mysql mysql<br>
&gt; but this just responded:<br>
&gt; chown: cannot access `mysql&#39;: No such file or directory<br>
&gt;<br>
&gt; Should one of those &#39;mysql&#39;s have been &#39;mysqld&#39;? I assume so, but I<br>
&gt; don&#39;t know which one.<br>
<br>
</div>Yes, that last one should be mysqld - thats the directory name and the<br>
command is changing the ownership of that directory to the mysql user<br>
and group.  Check it&#39;s worked with &#39;ls -la /var/run/mysqld&#39; - you should<br>
see all file (except the &quot;..&quot; owned by mysql)<br>
<div class="im"><br>
&gt; I&#39;ve just had a look at the /var/run/mysqld folder, and it looks<br>
&gt; completely empty. That doesn&#39;t seem like a good thing!???<br>
<br>
</div>Thats fine.  It should be empty when mysql isn&#39;t running (which it looks<br>
like it isn&#39;t from some of the output you&#39;ve posted below.<br>
<div class="im"><br>
&gt; Have I not even got mysql installed properly anymore?? This is just<br>
&gt; weird. How can an &#39;upgrade&#39; break things so badly??<br>
&gt;<br>
&gt; Found this thread:<br>
&gt;<br>
&gt; <a href="http://ubuntuforums.org/showthread.php?t=1601420" target="_blank">http://ubuntuforums.org/showthread.php?t=1601420</a><br>
&gt;<br>
&gt; $ sudo chown -R mysql:mysql /var/lib/mysql<br>
&gt; Then rebooted<br>
&gt;<br>
&gt;<br>
&gt; $ sudo service mysql status<br>
&gt; mysql respawn/post-start, (post-start) process 3234<br>
&gt;<br>
&gt;<br>
&gt; $ mysql -u mythtv -pmythtv mythconverg<br>
&gt; ERROR 2002 (HY000): Can&#39;t connect to local MySQL server through socket<br>
&gt; &#39;/var/run/mysqld/mysqld.sock&#39; (2)<br>
&gt;<br>
&gt; $ ps -A | grep mysql<br>
&gt; Returns nothing<br>
<br>
</div>^-- looks like the mysql service is failing to start correctly.<br>
<div class="im"><br>
&gt; Tried running mysqld out of bin:<br>
&gt;<br>
&gt; /usr/bin$ mysqld<br>
&gt; 111105 11:19:20 [Warning] option &#39;net_buffer_length&#39;: unsigned value<br>
&gt; 8388608 adjusted to 1048576<br>
&gt; 111105 11:19:20 [Warning] Can&#39;t create test file<br>
&gt; /var/lib/mysql/MythBox.lower-test<br>
&gt; 111105 11:19:20 [Warning] Can&#39;t create test file<br>
&gt; /var/lib/mysql/MythBox.lower-test<br>
&gt; mysqld: Can&#39;t change dir to &#39;/var/lib/mysql/&#39; (Errcode: 13)<br>
&gt; 111105 11:19:20 [ERROR] Aborting<br>
&gt;<br>
&gt; 111105 11:19:20 [Note] mysqld: Shutdown complete<br>
&gt;<br>
&gt; Tried running mysqld_safe out of bin:<br>
&gt;<br>
&gt; /usr/bin$ mysqld_safe<br>
&gt; 111105 11:21:25 mysqld_safe Logging to syslog.<br>
&gt; 111105 11:21:25 mysqld_safe Starting mysqld daemon with databases from<br>
&gt; /var/lib/mysql<br>
&gt; rm: cannot remove `/var/lib/mysql/MythBox.pid&#39;: Permission denied<br>
&gt; 111105 11:21:25 mysqld_safe mysqld from pid file<br>
&gt; /var/lib/mysql/MythBox.pid ended<br>
&gt;<br>
&gt; Im I getting somewhere here? Maybe the hole problem is just down to<br>
&gt; permissions? Or maybe it&#39;s permissions and paswords have been changed?<br>
&gt; One thing at a time. What should the permissions on these folders be and<br>
&gt; how do I change them?<br>
<br>
</div>Trying to run mysql under your user account (or root) will cause issues<br>
with permissions because either you wont have access to the mysql files,<br>
or if you run it as root, then it will create some files that it then<br>
wont be able to access when you run it as a service because then it will<br>
(should) run under the mysql user.<br>
<div><div></div><div class="h5"><br>
&gt; I&#39;m learning, but not enough :-)<br>
&gt;<br>
&gt; There&#39;s this sequence suggested by the guy on the forum thread from last<br>
&gt; year...<br>
&gt;       purge and reinstall mysql server<br>
&gt;       chgrp -R mysql /var/lib/mysql/<br>
&gt;       Check if mysql can run in savemode: /usr/bin: mysqld_safe<br>
&gt;       Somehow I lost my mysql.conf for upstart. So recreate it and paste<br>
&gt; exec sudo -u mysql /usr/sbin/mysqld #&lt;- important execute as use mysql<br>
&gt;<br>
&gt; but I don&#39;t even understand all of that, let alone have confidence in<br>
&gt; accieving it. Nor do I know if it will kill any database I once had<br>
&gt; (which I&#39;m hoping I can keep if possible, although I am losing hope that<br>
&gt; it even exists any more).<br>
&gt;<br>
&gt; The last thing I did was follow bills advice and run the &#39;post-start<br>
&gt; script&#39; from /etc/init/mysql.conf maually on the command line. Here&#39;s<br>
&gt; the results:<br>
&gt;<br>
&gt; $ for i in `seq 1 30` ; do<br>
&gt;   &gt;  /usr/bin/mysqladmin --defaults-file=&quot;${HOME}&quot;/debian.cnf ping&amp;&amp;  {<br>
&gt;   &gt;  exec &quot;${HOME}&quot;/debian-start<br>
&gt;   &gt;  # should not reach this line<br>
&gt;   &gt;              exit 2<br>
&gt;   &gt;          }<br>
&gt;   &gt;          sleep 1<br>
&gt;   &gt;      done<br>
&gt; Could not open required defaults file: /home/damian/debian.cnf<br>
&gt; Fatal error in defaults handling. Program aborted<br>
&gt; /usr/bin/mysqladmin: connect to server at &#39;localhost&#39; failed<br>
&gt; error: &#39;Can&#39;t connect to local MySQL server through socket<br>
&gt; &#39;/var/run/mysqld/mysqld.sock&#39; (2)&#39;<br>
&gt; Check that mysqld is running and that the socket:<br>
&gt; &#39;/var/run/mysqld/mysqld.sock&#39; exists!<br>
&gt; Could not open required defaults file: /home/damian/debian.cnf<br>
&gt; Fatal error in defaults handling. Program aborted<br>
&gt; /usr/bin/mysqladmin: connect to server at &#39;localhost&#39; failed<br>
&gt; error: &#39;Can&#39;t connect to local MySQL server through socket<br>
&gt; &#39;/var/run/mysqld/mysqld.sock&#39; (2)&#39;<br>
&gt; Check that mysqld is running and that the socket:<br>
&gt; &#39;/var/run/mysqld/mysqld.sock&#39; exists!<br>
&gt; etc etc repeat to infinity<br>
&gt;<br>
&gt; I then tried Bill&#39;s test to see if my mythconverg database was still<br>
&gt; there .. and I think it is! :-) Here&#39;s the results:<br>
&gt;<br>
&gt; $ sudo -i<br>
&gt; root@MythBox:~#    cd /var/lib/mysql/mythconverg<br>
&gt; root@MythBox:/var/lib/mysql/mythconverg#    ls -l<br>
&gt; total 19748<br>
&gt; -rw-rw---- 1 mysql mysql    9255 2011-05-09 07:53 archiveitems.frm<br>
&gt; -rw-rw---- 1 mysql mysql       0 2011-10-27 08:11 archiveitems.MYD<br>
&gt; -rw-rw---- 1 mysql mysql    2048 2011-10-27 08:11 archiveitems.MYI<br>
&gt; -rw-rw---- 1 mysql mysql    8630 2011-05-09 07:53 callsignnetworkmap.frm<br>
&gt; -rw-rw---- 1 mysql mysql       0 2011-10-27 08:11 callsignnetworkmap.MYD<br>
&gt; -rw-rw---- 1 mysql mysql    1024 2011-10-27 08:11 callsignnetworkmap.MYI<br>
&gt; -rw-rw---- 1 mysql mysql    9752 2011-05-09 07:53 capturecard.frm<br>
&gt; -rw-rw---- 1 mysql mysql     328 2011-10-27 08:11 capturecard.MYD<br>
&gt; and lots more of this .. as expected.<br>
<br>
</div></div>Looks like your db is there, which is a good start.  I&#39;d say that<br>
following the complete remove and reinstall risks loosing that.<br>
<div class="im"><br>
&gt; Ok, my head hurts now. Where next?<br>
<br>
</div>Have you checked the mysql log files in /var/log/mysql?  I&#39;d suggest you<br>
go into /var/log/mysql, delete any existing log files (maybe take a copy<br>
elsewhere just in case).  Check that the /var/log/mysql directory is<br>
owned and writable by the mysql user.  Then try and start the mysql<br>
service.  Check to see if the process is running and then check the log<br>
files to see what they say.  So, commands something like this:<br>
<br>
# cd /var/log/mysql<br>
<br>
# sudo rm *.err *.log<br>
<br>
# ls -la /var/log/mysql<br>
Check that the . directory is owned by mysql and is writeable eg:<br>
robert@quad ~ $ ls -la /var/log/mysql/<br>
total 4872<br>
drwxr-xr-x  2 mysql mysql    4096 May 13 14:40 .<br>
drwxr-xr-x 19 root  root     4096 Nov  2 03:15 ..<br>
<br>
# sudo service mysql start (?? I assume this is how you start service on<br>
Ubuntu based on your postings above - I&#39;m not a Ubuntu user, so I&#39;m not<br>
familiar)<br>
<br>
Wait a few seconds<br>
<br>
# ps ax |grep -i mysql<br>
<br>
Based on your output above, I&#39;d expect this to report that it isn&#39;t running.<br>
<br>
# cat /var/log/mysql/*.err /var/log/mysql/*.log<br>
<br>
And see what falls out.<br>
<br>
If it looks like permissions, post and much &#39;ls -la&#39; output as you can<br>
from the various mysql directories including<br>
/var/run/mysql<br>
/var/log/mysql<br>
/var/lib/mysql<br>
/etc/mysql<br>
<br>
Hoepfully someone will be able to spot the problem<br>
<br>
Good luck!<br>
<font color="#888888">Robert.<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org">mythtv-users@mythtv.org</a><br>
<a href="http://www.mythtv.org/mailman/listinfo/mythtv-users" target="_blank">http://www.mythtv.org/mailman/listinfo/mythtv-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div>I&#39;ve not been following this closely either, but it does look like mysql is dying so those logs will be important.</div><div><br></div><div>On a different note, why did you upgrade to Mythbuntu 11.10? I&#39;m genuinely interested in knowing. Was there something you were hoping it would fix? Were you trying to get a newer build of MythTV? Something else?</div>

-- <br>Thomas Mashos<br>