<div class="gmail_quote">On Sat, Nov 5, 2011 at 9:09 AM, Robert Longbottom <span dir="ltr"><<a href="mailto:rongblor@googlemail.com">rongblor@googlemail.com</a>></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>
> :-) Thanks Geoff, Bill and John for helping out.<br>
<br>
</div>I'll start by saying I've not been following this, but here goes with a<br>
few suggestions...<br>
<div class="im"><br>
> Here's the latest. I've done a lot, and think I've got enough to clarify<br>
> the problem a bit to 'those of you who know', but I'm at the edge of my<br>
> understanding again. Here's where it's at ....<br>
><br>
> Both mysql.txt and config.xml contain '192.168.0.2' rather than<br>
> 'MythBox', but I think I need to fix my bigger problems with mysql<br>
> before I start messing with the MythTV setup. I can't currently log into<br>
> mysql as root, so trying to fix anything further down the line seems futile.<br>
><br>
> I did run:<br>
> /var/run$ chown -R mysql:mysql mysql<br>
> but this just responded:<br>
> chown: cannot access `mysql': No such file or directory<br>
><br>
> Should one of those 'mysql's have been 'mysqld'? I assume so, but I<br>
> don'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's worked with 'ls -la /var/run/mysqld' - you should<br>
see all file (except the ".." owned by mysql)<br>
<div class="im"><br>
> I've just had a look at the /var/run/mysqld folder, and it looks<br>
> completely empty. That doesn't seem like a good thing!???<br>
<br>
</div>Thats fine. It should be empty when mysql isn't running (which it looks<br>
like it isn't from some of the output you've posted below.<br>
<div class="im"><br>
> Have I not even got mysql installed properly anymore?? This is just<br>
> weird. How can an 'upgrade' break things so badly??<br>
><br>
> Found this thread:<br>
><br>
> <a href="http://ubuntuforums.org/showthread.php?t=1601420" target="_blank">http://ubuntuforums.org/showthread.php?t=1601420</a><br>
><br>
> $ sudo chown -R mysql:mysql /var/lib/mysql<br>
> Then rebooted<br>
><br>
><br>
> $ sudo service mysql status<br>
> mysql respawn/post-start, (post-start) process 3234<br>
><br>
><br>
> $ mysql -u mythtv -pmythtv mythconverg<br>
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket<br>
> '/var/run/mysqld/mysqld.sock' (2)<br>
><br>
> $ ps -A | grep mysql<br>
> Returns nothing<br>
<br>
</div>^-- looks like the mysql service is failing to start correctly.<br>
<div class="im"><br>
> Tried running mysqld out of bin:<br>
><br>
> /usr/bin$ mysqld<br>
> 111105 11:19:20 [Warning] option 'net_buffer_length': unsigned value<br>
> 8388608 adjusted to 1048576<br>
> 111105 11:19:20 [Warning] Can't create test file<br>
> /var/lib/mysql/MythBox.lower-test<br>
> 111105 11:19:20 [Warning] Can't create test file<br>
> /var/lib/mysql/MythBox.lower-test<br>
> mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)<br>
> 111105 11:19:20 [ERROR] Aborting<br>
><br>
> 111105 11:19:20 [Note] mysqld: Shutdown complete<br>
><br>
> Tried running mysqld_safe out of bin:<br>
><br>
> /usr/bin$ mysqld_safe<br>
> 111105 11:21:25 mysqld_safe Logging to syslog.<br>
> 111105 11:21:25 mysqld_safe Starting mysqld daemon with databases from<br>
> /var/lib/mysql<br>
> rm: cannot remove `/var/lib/mysql/MythBox.pid': Permission denied<br>
> 111105 11:21:25 mysqld_safe mysqld from pid file<br>
> /var/lib/mysql/MythBox.pid ended<br>
><br>
> Im I getting somewhere here? Maybe the hole problem is just down to<br>
> permissions? Or maybe it's permissions and paswords have been changed?<br>
> One thing at a time. What should the permissions on these folders be and<br>
> 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>
> I'm learning, but not enough :-)<br>
><br>
> There's this sequence suggested by the guy on the forum thread from last<br>
> year...<br>
> purge and reinstall mysql server<br>
> chgrp -R mysql /var/lib/mysql/<br>
> Check if mysql can run in savemode: /usr/bin: mysqld_safe<br>
> Somehow I lost my mysql.conf for upstart. So recreate it and paste<br>
> exec sudo -u mysql /usr/sbin/mysqld #<- important execute as use mysql<br>
><br>
> but I don't even understand all of that, let alone have confidence in<br>
> accieving it. Nor do I know if it will kill any database I once had<br>
> (which I'm hoping I can keep if possible, although I am losing hope that<br>
> it even exists any more).<br>
><br>
> The last thing I did was follow bills advice and run the 'post-start<br>
> script' from /etc/init/mysql.conf maually on the command line. Here's<br>
> the results:<br>
><br>
> $ for i in `seq 1 30` ; do<br>
> > /usr/bin/mysqladmin --defaults-file="${HOME}"/debian.cnf ping&& {<br>
> > exec "${HOME}"/debian-start<br>
> > # should not reach this line<br>
> > exit 2<br>
> > }<br>
> > sleep 1<br>
> > done<br>
> Could not open required defaults file: /home/damian/debian.cnf<br>
> Fatal error in defaults handling. Program aborted<br>
> /usr/bin/mysqladmin: connect to server at 'localhost' failed<br>
> error: 'Can't connect to local MySQL server through socket<br>
> '/var/run/mysqld/mysqld.sock' (2)'<br>
> Check that mysqld is running and that the socket:<br>
> '/var/run/mysqld/mysqld.sock' exists!<br>
> Could not open required defaults file: /home/damian/debian.cnf<br>
> Fatal error in defaults handling. Program aborted<br>
> /usr/bin/mysqladmin: connect to server at 'localhost' failed<br>
> error: 'Can't connect to local MySQL server through socket<br>
> '/var/run/mysqld/mysqld.sock' (2)'<br>
> Check that mysqld is running and that the socket:<br>
> '/var/run/mysqld/mysqld.sock' exists!<br>
> etc etc repeat to infinity<br>
><br>
> I then tried Bill's test to see if my mythconverg database was still<br>
> there .. and I think it is! :-) Here's the results:<br>
><br>
> $ sudo -i<br>
> root@MythBox:~# cd /var/lib/mysql/mythconverg<br>
> root@MythBox:/var/lib/mysql/mythconverg# ls -l<br>
> total 19748<br>
> -rw-rw---- 1 mysql mysql 9255 2011-05-09 07:53 archiveitems.frm<br>
> -rw-rw---- 1 mysql mysql 0 2011-10-27 08:11 archiveitems.MYD<br>
> -rw-rw---- 1 mysql mysql 2048 2011-10-27 08:11 archiveitems.MYI<br>
> -rw-rw---- 1 mysql mysql 8630 2011-05-09 07:53 callsignnetworkmap.frm<br>
> -rw-rw---- 1 mysql mysql 0 2011-10-27 08:11 callsignnetworkmap.MYD<br>
> -rw-rw---- 1 mysql mysql 1024 2011-10-27 08:11 callsignnetworkmap.MYI<br>
> -rw-rw---- 1 mysql mysql 9752 2011-05-09 07:53 capturecard.frm<br>
> -rw-rw---- 1 mysql mysql 328 2011-10-27 08:11 capturecard.MYD<br>
> and lots more of this .. as expected.<br>
<br>
</div></div>Looks like your db is there, which is a good start. I'd say that<br>
following the complete remove and reinstall risks loosing that.<br>
<div class="im"><br>
> Ok, my head hurts now. Where next?<br>
<br>
</div>Have you checked the mysql log files in /var/log/mysql? I'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'm not a Ubuntu user, so I'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'd expect this to report that it isn'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 'ls -la' 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'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'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>