View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 25 posts ] 
Go to page 1, 2  Next

Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sun May 28, 2006 9:00 pm 
Offline
Joined: Sun Nov 14, 2004 10:04 am
Posts: 263
Location: Toronto, Canada
Hi folks:

Well, just when I was enjoying use of Mythie, she broke down. For some
reason, I can't start the backend. Error message is:

Code:
root@box:~# mythbackend -d
2006-05-28 18:58:44.605 Using runtime prefix = /usr
root@box:~# 2006-05-28 18:58:44.620 New DB connection, total: 1
2006-05-28 18:58:44.621 Unable to connect to database!
2006-05-28 18:58:44.621 Driver error was [1/2002]:
QMYSQL3: Unable to connect
Database error was:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)



When I check the /mysqld directory, it appears to be empty. I did some
googling, but all the other situations seemed a bit different than mine.

Any help would be appreciated.


Shplad

_________________
KnoppMyth R5C7
Abit NF7-S
Athlon XP Mobile 2500+
Hauppauge PVR-150 + PVR-150MCE
nVidia Geforce 6600GT
Samsung Spinpoint SATA 120GB
NEC ND-3520A DVD
Seasonic Super Tornado 350
BTC 9019URF Wireless Kbd. w. Joystick


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 28, 2006 9:29 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi shplad,

What was you doing to it just prior to the failure? What version? hard drive full? df -h & df -i?

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 9:47 am 
Offline
Joined: Sun Nov 14, 2004 10:04 am
Posts: 263
Location: Toronto, Canada
Mike:

Thanks for your reply. Well, at bootup a while ago, the system gave me
some message about possible filesystem problems, and suggested I run
fsck on the filesystem. I booted from CD and ran fsck, and it reported no
problems whatsoever, which left me confused. I believe this all started
because I have had trouble intermittenly with the machine not shutting
down properly, and a few times have had to resort to powering it off with
the power button instead. (I don't know enough about Linux to
troubleshoot shutdown issues.)

I checked disk usage, and there's tons of space left. Any other
suggestions? Version is R5A22, as per my .sig.

Per some Google searches I found, I checked the "my.cnf" file, and it
seemed to be fine. I also read that permission must be correct on the
mysql directory. What permissions do you have for that directory, mjl?




Thanks,


Shplad

mjl wrote:
Hi shplad,

What was you doing to it just prior to the failure? What version? hard drive full? df -h & df -i?

Mike

_________________
KnoppMyth R5C7
Abit NF7-S
Athlon XP Mobile 2500+
Hauppauge PVR-150 + PVR-150MCE
nVidia Geforce 6600GT
Samsung Spinpoint SATA 120GB
NEC ND-3520A DVD
Seasonic Super Tornado 350
BTC 9019URF Wireless Kbd. w. Joystick


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 6:38 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi shplad,

I am not that much advanced as a linux user either, but what little I think I know I try to throw out as an idea to make something fall into place for those that do know.

Even if you have been a little mean to your machine with the on/off method of shutdown, I would hate to really just blame that only. I have friend that has been running a show & tell caldera 1.3 that I built for him years ago. And for years now, every night, he flips the breaker off when he closes the store and in the morning it is back on, and telling him the time. (he fixes watches & computers) :)

If it was busy doing commercial killing or recording, maybe, but you could have caught it doing database cleanup and that may have wacked the mysql. Have you tried doing a cleanup on that? Cecil has some tips posted to fix some of those errors or it at least checks them.

If the gui comes up, maybe go thrugh the setups and just see if somethings look normal.

As for the shutdown, can you do a halt or reboot as root? Isn't there a setting in mythtv-setup that can also affect shutdown? I think I saw something with a check box.

Sorry I can't offer much else for ideas. The A22 was pretty good if I recall correctly. (missed the A22 in the sig as that doesn't show when posting) A friend of mine ran that for a long time until he went to A30.x, he kind of wishes sometimes that he had stayed with A22 so that is a pretty favorable comment.

If I dream up anything for you to try, I will let you know.
Have a great day anyway!
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 7:13 pm 
Offline
Joined: Sun Mar 21, 2004 10:01 am
Posts: 77
Is the Mysql dameon starting up?

#/etc/init.d/mysql restart

If Mysql is starting then try connecting to it from the command line:

$mysql -u mythtv -p

Enter the mythtv password for the database. If it lets you connect then disconnect from mysql:

>exit

Prior to running any commands against your database, back it up:

#mkdir /myth/backup
#mysqldump -u [username] -p mythconverg > /myth/backup/backupfile.sql

and run a check on the database, from the $ prompt or as root (the mysql dameon needs to be running in order to use this tool):

#mysqlcheck -u [username] -p mythconverg

substitute [username] with a user (without the []) that has rights to the mythconverg database such as mythtv. Enter the password when prompted for after pressing enter.

If your database comes back clean then your half way there. Try starting the mythbackend again as root:

#/etc/init.d/mythtv-backend start

if your database comes back with errors then we need to fix them. First backup your database if you havn't done so prior.

Once you have backed up your database, check how much space is on your / by typing in:

#df

You should see something similar to this come back at you:

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda1 6279716 2675628 3286004 45% /
/dev/hda4 451084520 92991208 334809908 22% /myth

You are checking the space on /dev/hda1. If it is close to being filled then you need to make some room before repairing your database. Check your log file directory as this gets filled up. Logs are kept in /var/log. I had a problem where mysql was filling up it's logs with a bunch of bin files in /var/log/mysql (you need to be root to access this directory). The bin files are really good to have since they contain all of the newest changes to your database prior to being backedup. Now since this is only a DVR, if I lost a show for one day (I backup my DB nightly) due to a problem with my database during the day, I'm not going to hang myself. I turned off the option in mysql to create these bin files as I was recieving phone calls from the wife at least once every two months stating the system locked up from lack of space on the drive. By the way, I had upgraded my drive to a larger one since my mysql log file fillup so I have a lot more room and probably can turn the bin file creation back on if I wanted to.

If you have plenty of room on /dev/hda1 and after your database is backed up run mysqlcheck again this time adding the --auto-repair option:

#mysqlcheck --auto-repair -u [username] -p mythconverg

Once all the errors are corrected then try starting your mythtv-backend again.

I hope this helps.


Last edited by dmcman73 on Mon May 29, 2006 9:32 pm, edited 1 time in total.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 9:07 pm 
Offline
Joined: Sun Nov 14, 2004 10:04 am
Posts: 263
Location: Toronto, Canada
[quote="dmcman73"]Is the Mysql dameon starting up?

Code:
root@box:# /etc/init.d/mysqld restart
-bash: /etc/init.d/mysqld: No such file or directory



Shplad

_________________
KnoppMyth R5C7
Abit NF7-S
Athlon XP Mobile 2500+
Hauppauge PVR-150 + PVR-150MCE
nVidia Geforce 6600GT
Samsung Spinpoint SATA 120GB
NEC ND-3520A DVD
Seasonic Super Tornado 350
BTC 9019URF Wireless Kbd. w. Joystick


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 9:32 pm 
Offline
Joined: Sun Mar 21, 2004 10:01 am
Posts: 77
Sorry, it should be:

/etc/init.d/mysql not mysqld


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 9:37 pm 
Offline
Joined: Sun Nov 14, 2004 10:04 am
Posts: 263
Location: Toronto, Canada
Thanks. I thought that was what you meant.
When I tried it, I got the same thing:

Code:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


What next?

Shplad



dmcman73 wrote:
Sorry, it should be:

/etc/init.d/mysql not mysqld

_________________
KnoppMyth R5C7
Abit NF7-S
Athlon XP Mobile 2500+
Hauppauge PVR-150 + PVR-150MCE
nVidia Geforce 6600GT
Samsung Spinpoint SATA 120GB
NEC ND-3520A DVD
Seasonic Super Tornado 350
BTC 9019URF Wireless Kbd. w. Joystick


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 10:00 pm 
Offline
Joined: Sun Mar 21, 2004 10:01 am
Posts: 77
Verify that mysql is('nt) running

# ps -ef | grep mysql

You should recieve something similar if it is running:

root 11217 1 0 May28 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql 11253 11217 0 May28 ? 00:00:55 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
root 11254 11217 0 May28 ? 00:00:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
root 22294 11901 0 23:50 ttyp1 00:00:00 grep mysql

If it is not then there is a possibility that you are missing the mysqld.sock or it has become corrupted. Check for it in /var/run/mysqld/. If it is in there try moving it to another directory like /myth/backup and then try running mysql in safe mode (yes there is a d at the end of the mysql):

#/usr/bin/mysqld_safe &

If it starts up this way then this may repair what was preventing it to run before.

If it starts, check to see if a new mysqld.sock file was created. If it was I would try rebooting your system and see if mysql and the backend comes back up. If the backend still does not come back up but mysql now starts normally, then follow the steps I wrote on checking your tables and possibly repairing them if needed.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 8:49 am 
Offline
Joined: Sun Nov 14, 2004 10:04 am
Posts: 263
Location: Toronto, Canada
Hmmm...I think we're going around in circles here. I thought when I mentioned in my
first post that the mysqld directory was empty that it would be obvious that there was no
mysqld.sock file. I guess it wasn't so obvious.

Anyways, the .sock file is missing. What do you suggest I do next?

Thanks again for all your help and detailed explanations.



Shplad


dmcman73 wrote:
Verify that mysql is('nt) running

# ps -ef | grep mysql

You should recieve something similar if it is running:

root 11217 1 0 May28 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql 11253 11217 0 May28 ? 00:00:55 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
root 11254 11217 0 May28 ? 00:00:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
root 22294 11901 0 23:50 ttyp1 00:00:00 grep mysql

If it is not then there is a possibility that you are missing the mysqld.sock or it has become corrupted. Check for it in /var/run/mysqld/. If it is in there try moving it to another directory like /myth/backup and then try running mysql in safe mode (yes there is a d at the end of the mysql):

#/usr/bin/mysqld_safe &

If it starts up this way then this may repair what was preventing it to run before.

If it starts, check to see if a new mysqld.sock file was created. If it was I would try rebooting your system and see if mysql and the backend comes back up. If the backend still does not come back up but mysql now starts normally, then follow the steps I wrote on checking your tables and possibly repairing them if needed.

_________________
KnoppMyth R5C7
Abit NF7-S
Athlon XP Mobile 2500+
Hauppauge PVR-150 + PVR-150MCE
nVidia Geforce 6600GT
Samsung Spinpoint SATA 120GB
NEC ND-3520A DVD
Seasonic Super Tornado 350
BTC 9019URF Wireless Kbd. w. Joystick


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 10:32 am 
Offline
Joined: Sun Mar 21, 2004 10:01 am
Posts: 77
mysql.sock is created when mysql starts up.

1. Are you starting mysql as root? Start mysql as root if you haven't been.

2. If mysql still does not start as root or never started as root, then start mysql in safe mode as my previous post instructed (as root):

#/usr/bin/mysqld_safe &

Let me know if you can start it in safe mode and we can take it from there.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 3:37 pm 
Offline
Joined: Sun Nov 14, 2004 10:04 am
Posts: 263
Location: Toronto, Canada
Okay, well here's what I got when I tried to run in safe mode:

Code:
root@box:/# mysqld_safe
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6240]: started
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6245]: ended



shplad

_________________
KnoppMyth R5C7
Abit NF7-S
Athlon XP Mobile 2500+
Hauppauge PVR-150 + PVR-150MCE
nVidia Geforce 6600GT
Samsung Spinpoint SATA 120GB
NEC ND-3520A DVD
Seasonic Super Tornado 350
BTC 9019URF Wireless Kbd. w. Joystick


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 5:02 pm 
Offline
Joined: Sun Mar 21, 2004 10:01 am
Posts: 77
Ok, instead of bouncing back and forth, go through the help files here:

http://dev.mysql.com/doc/refman/5.0/en/ ... erver.html

http://dev.mysql.com/doc/refman/5.0/en/ ... erver.html

The first link may have the answers for you. As it explains, the sock file is only used for a local host system running mysql, if the server is connecting to a remote server then the sock file is not needed and will use a TCP/IP connection.

Now question I forgot to ask you prior, did you change the host name on this box? Make any kind of networking changes?

I hasd problems on another box where it could not connect due to me changing the host name of the system from say localhost to mythtvhost.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 9:23 pm 
Offline
Joined: Sun Nov 14, 2004 10:04 am
Posts: 263
Location: Toronto, Canada
Well, I tried some (but not all) of the suggestions from those webpages you recommended,
but no luck. I swear half of those recommendations actually require the mysqld to already
be running. The other half require some significant knowledge of mysql. Go figure.
With zero knowledge of mysql, I'm totally lost at this point. Thanks for your ideas, though.

I never changed the hostname. Had no reason to. Never made any networking changes.

Only thing I could think might have caused this was that a while back, I had to hard power off
the machine without shutting down several times because it wouldn't shut down.
After that, some of the permissions just didn't seem right. Since the system recommended
running an fsck, I did that, after booting from CD, and fsck reported
no problems. At that point, I figured things were okay<sigh>

Thanks for trying though. Any other ideas?

Shplad



dmcman73 wrote:
Ok, instead of bouncing back and forth, go through the help files here:

http://dev.mysql.com/doc/refman/5.0/en/ ... erver.html

http://dev.mysql.com/doc/refman/5.0/en/ ... erver.html

The first link may have the answers for you. As it explains, the sock file is only used for a local host system running mysql, if the server is connecting to a remote server then the sock file is not needed and will use a TCP/IP connection.

Now question I forgot to ask you prior, did you change the host name on this box? Make any kind of networking changes?

I hasd problems on another box where it could not connect due to me changing the host name of the system from say localhost to mythtvhost.

_________________
KnoppMyth R5C7
Abit NF7-S
Athlon XP Mobile 2500+
Hauppauge PVR-150 + PVR-150MCE
nVidia Geforce 6600GT
Samsung Spinpoint SATA 120GB
NEC ND-3520A DVD
Seasonic Super Tornado 350
BTC 9019URF Wireless Kbd. w. Joystick


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 5:29 am 
Offline
Joined: Sun Mar 21, 2004 10:01 am
Posts: 77
Try running this command as root:

#myisamchk

This command will check the mysql tables for any errors and it requires that mysql to not be running. Usually you would run the command with:

#myisamchk <tablename>

to specify each table individually, running it without specifying a table will force it to check every single one in your database so it may take some time.

If your database comes back clean then the only other thing I can think of is that you may have a corruption in your mysql install such as a config file.

Without actually being ont he box to check everything it is pretty difficult to trouble shot any further.

What do your logs say? They are located in /var/log/mysql.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ] 
Go to page 1, 2  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu