View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 13 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sat Jun 02, 2007 9:56 pm 
Offline
Joined: Fri Dec 22, 2006 3:00 pm
Posts: 158
My R5F1 box suddenly developed a fault whereby mysql appears to be unable to start.

Strange as it may sound, all I did to break it was to copy over a xorg.conf which I had set up previously (and had working with my HDTV). Maybe I caused a problem because I copied over the xorg.conf before exiting MythTV?

When my box comes up I notice a message about mysql failure, then it boots to a Myth screen where it prompts me to select my language, then goes to a server setup screen where everything appears to be ok.

in /vart/log/syslog I see the following messages ..

Jun 2 20:45:43 mythtv lircd-0.8.1-CVS-pvr150[3201]: lircd(all) ready
Jun 2 20:45:44 mythtv mysqld_safe[3272]: started
Jun 2 20:45:45 mythtv mysqld[3275]: 070602 20:45:45 InnoDB: Started; log sequence number 0 43665
Jun 2 20:45:45 mythtv mysqld[3275]: 070602 20:45:45 [ERROR] Fatal error: Can't open and lock privilege tables: File './mysql/host.MYD' not found (Errcode: 5)
Jun 2 20:45:45 mythtv mysqld_safe[3286]: ended
Jun 2 20:45:58 mythtv /etc/init.d/mysql[3421]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jun 2 20:45:58 mythtv /etc/init.d/mysql[3421]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
Jun 2 20:45:58 mythtv /etc/init.d/mysql[3421]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jun 2 20:45:58 mythtv /etc/init.d/mysql[3421]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Jun 2 20:45:58 mythtv /etc/init.d/mysql[3421]:

does anyone have any suggestions how I might fix this?

<EDIT> I tried to restart mysql, but no joy :(

root@mythtv:/var/log# sudo /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!

I have read of this problem, reported recently on the mythtv archive, unfortunately I haven't been able to find a solution there, it looks like it might mean yet another reinstall of R5F1,

thanks,

Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 6:49 am 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
bbear wrote:
Jun 2 20:45:45 mythtv mysqld[3275]: 070602 20:45:45 [ERROR] Fatal error: Can't open and lock privilege tables: File './mysql/host.MYD' not found (Errcode: 5)


Sounds to me like you whacked your /etc/mysql/my.cnf file. See http://forums.mysql.com/read.php?11,51024,51024 , make sure your datadir (and the other directory entries) is correct.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 9:27 am 
Offline
Joined: Fri Dec 22, 2006 3:00 pm
Posts: 158
Hi,

my.cnf is there, in the /etc/mysql directory. I really don't know what it should look like, but at a glance it would look to be ok ..

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/serve ... ables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
old_passwords = false # inserted by debconf
# Activate the above for connections from hosts running Debian Woody/Sarge!
#
# Prior to MySQL 5.0, user passwords were stored in a rather weak way. This
# has been improved with the drawback that client programs shipped with
# Debian Woody/Sarge (technically: linked against libmysqlclient.so.12 or
# earlier) cannot connect any more if either their account has either been
# created or their password has been modified using MySQL 5.0.
# See http://dev.mysql.com/doc/refman/5.0/en/old-client.html
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
#
# * Query Cache Configuration
#
query_cache_limit = 1048576
query_cache_size = 16777216
query_cache_type = 1
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#
# The following can be used as easy to replay backup logs or for replication.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
# WARNING: Using expire_logs_days without bin_log crashes the server! See README.Debian!
#expire_logs_days = 10
#max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * BerkeleyDB
#
# According to an MySQL employee the use of BerkeleyDB is now discouraged
# and support for it will probably cease in the next versions.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
#skip-innodb
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the ndbd storage daemons,
# not from the ndb_mgmd management daemon.
#
# [MYSQL_CLUSTER]
# ndb-connectstring=127.0.0.1


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 9:38 am 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
What does
Code:
locate host.MYD
yield? And if it does exist, what are the permissions?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 9:42 am 
Offline
Joined: Fri Dec 22, 2006 3:00 pm
Posts: 158
locate: warning: database `/var/cache/locate/locatedb' is more than 8 days old

-rw-r--r-- 1 root root 553448 May 11 01:02 /var/cache/locate/locatedb

On that long thread at the mysql forums, I saw some stuff about files needing to be owned by 'mysql', so might it be a problem that on my system they are owned by 'root'?

thanks,

Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 9:47 am 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
bbear wrote:
locate: warning: database `/var/cache/locate/locatedb' is more than 8 days old
If you run updatedb this warning will go away.

bbear wrote:
-rw-r--r-- 1 root root 553448 May 11 01:02 /var/cache/locate/locatedb
Wrong file...

bbear wrote:
On that long thread at the mysql forums, I saw some stuff about files needing to be owned by 'mysql', so might it be a problem that on my system they are owned by 'root'?

thanks,

Kevin
Yep, that's why I was asking about the permissions on host.MYD :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 9:52 am 
Offline
Joined: Fri Dec 22, 2006 3:00 pm
Posts: 158
updatedb worked, locate can now find 'host.MYD' but I can't query the permissions on it ..

root@mythtv:/var/lib/mysql# locate host.MYD
/var/lib/mysql/mysql/host.MYD
root@mythtv:/var/lib/mysql# ls -lart /var/lib/mysql/mysql/host.MYD
ls: /var/lib/mysql/mysql/host.MYD: Input/output error
root@mythtv:/var/lib/mysql# file /var/lib/mysql/mysql/host.MYD
/var/lib/mysql/mysql/host.MYD: ERROR: cannot open `/var/lib/mysql/mysql/host.MYD' (Input/output error)

Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 10:06 am 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
bbear wrote:
updatedb worked, locate can now find 'host.MYD' but I can't query the permissions on it ..

root@mythtv:/var/lib/mysql# locate host.MYD
/var/lib/mysql/mysql/host.MYD
root@mythtv:/var/lib/mysql# ls -lart /var/lib/mysql/mysql/host.MYD
ls: /var/lib/mysql/mysql/host.MYD: Input/output error
root@mythtv:/var/lib/mysql# file /var/lib/mysql/mysql/host.MYD
/var/lib/mysql/mysql/host.MYD: ERROR: cannot open `/var/lib/mysql/mysql/host.MYD' (Input/output error)

Kevin
Better check your /var/log/syslog and /var/log/messages files, you may have a problem with your drive.

My host.MYD is an empty regular file
Code:
ls -l /var/lib/mysql/mysql
total 104
-rw-rw----  1 mysql mysql    0 Jun 24  2004 columns_priv.MYD
-rw-rw----  1 mysql mysql 1024 Jun 24  2004 columns_priv.MYI
-rw-rw----  1 mysql mysql 8778 Jun 24  2004 columns_priv.frm
-rw-rw----  1 mysql mysql  612 Dec  3 13:00 db.MYD
-rw-rw----  1 mysql mysql 3072 Dec  3 13:00 db.MYI
-rw-rw----  1 mysql mysql 9088 Jun 24  2004 db.frm
-rw-rw----  1 mysql mysql    0 Jun 24  2004 func.MYD
-rw-rw----  1 mysql mysql 1024 Jun 24  2004 func.MYI
-rw-rw----  1 mysql mysql 8641 Jun 24  2004 func.frm
-rw-rw----  1 mysql mysql    0 Jun 24  2004 host.MYD
-rw-rw----  1 mysql mysql 1024 Jun 24  2004 host.MYI
-rw-rw----  1 mysql mysql 9064 Jun 24  2004 host.frm
-rw-rw----  1 mysql mysql    0 Jun 24  2004 tables_priv.MYD
-rw-rw----  1 mysql mysql 1024 Jun 24  2004 tables_priv.MYI
-rw-rw----  1 mysql mysql 8877 Jun 24  2004 tables_priv.frm
-rw-rw----  1 mysql mysql  420 Nov 20  2004 user.MYD
-rw-rw----  1 mysql mysql 2048 Nov 21  2004 user.MYI
-rw-rw----  1 mysql mysql 9806 Jun 24  2004 user.frm
This is on my R5D1 system. Can you remove host.MYD and recreate it?


Top
 Profile  
 
PostPosted: Sun Jun 03, 2007 3:47 pm 
Offline
Joined: Fri Dec 22, 2006 3:00 pm
Posts: 158
slowtolearn,
looks like you were right, my drive seems to be hosed :cry:

I just got back after being out for few hours and turned on my Myth box from cold and saw the following messages:

Root: Multiply-claimed block(s) in inode 189210 : 469882 469883
Root: Multiply-claimed block(s) in inode 189215 : 469883
Root: Multiply-claimed block(s) in inode 189299 : 469882
Root: (There are 3 inodes containing multiply-claimed blocks.)
Root: File /var/log/auth.log (inpode #189210, mod time Sun Jun 3 09:08:20 2007)
Root: /var/log/debug (inode #189215, mod time Sun Jun 3 09:03:13 2007)
Root: /var/log/user.log (inode #189299, mod time Sun Jun 3 09:08:19 2007)
Root:
Root: UNEXPECTED INCONSISTENCY: RUN fsck MANUALLY.
(i.e., without -a or -p options)
fsck died with exit status 4
failed (code 4)
* An automatic file system check (fsck) of the root filesystem failed.

I have just downloaded the SeaTools program from the Seagate website and are going to run some diagnostics.

This drive is just a few weeks old, now wonder they are selling for so little these days. Because it is OEM that probably means sending back to the manufacturer,

Kevin


Top
 Profile  
 
PostPosted: Sun Jun 03, 2007 4:10 pm 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
bbear wrote:
slowtolearn,
looks like you were right, my drive seems to be hosed :cry:

I just got back after being out for few hours and turned on my Myth box from cold and saw the following messages:

Root: Multiply-claimed block(s) in inode 189210 : 469882 469883
Root: Multiply-claimed block(s) in inode 189215 : 469883
Root: Multiply-claimed block(s) in inode 189299 : 469882
Root: (There are 3 inodes containing multiply-claimed blocks.)
Root: File /var/log/auth.log (inpode #189210, mod time Sun Jun 3 09:08:20 2007)
Root: /var/log/debug (inode #189215, mod time Sun Jun 3 09:03:13 2007)
Root: /var/log/user.log (inode #189299, mod time Sun Jun 3 09:08:19 2007)
Root:
Root: UNEXPECTED INCONSISTENCY: RUN fsck MANUALLY.
(i.e., without -a or -p options)
fsck died with exit status 4
failed (code 4)
* An automatic file system check (fsck) of the root filesystem failed.
That would certainly explain the issue you were seeing with the host.MYD file. No fun...

bbear wrote:
I have just downloaded the SeaTools program from the Seagate website and are going to run some diagnostics.

This drive is just a few weeks old, now wonder they are selling for so little these days. Because it is OEM that probably means sending back to the manufacturer,
I have had very good luck with Seagate returns, they usually turn them around in less than a week.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 4:44 pm 
Offline
Joined: Fri Dec 22, 2006 3:00 pm
Posts: 158
slowtolearn,
I am wondering if shutting down my MythBox incorrectly could have caused this corrupt file system.
Normally I shut the box down via the KnoppMyth menu but my children over this past week have just been hitting the power button (because I haven't told them otherwise). Linux is pretty robust isn't it?

Also, I realize now that ever since installing R5F1 I have noticed some error, some fail message about fsck already mounted. Since Myth was coming up I assumed it was a bogus message, but perhaps I should have pain more attention to it.

BTW SeaTools has not found any problem yet with my drive, the short test passed ok and it is 75% through the long test. Not sure if it performs any writes to disk, I am assuming it does otherwise it is not much use as a diagnostic tool,

Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 5:21 pm 
Offline
Joined: Wed Nov 16, 2005 8:55 pm
Posts: 1381
Location: Farmington, MI USA
bbear wrote:
I am wondering if shutting down my MythBox incorrectly could have caused this corrupt file system.
Normally I shut the box down via the KnoppMyth menu but my children over this past week have just been hitting the power button (because I haven't told them otherwise). Linux is pretty robust isn't it?
Yes it is, but it isn't impervious to abuse (ungraceful shutdowns).

bbear wrote:
BTW SeaTools has not found any problem yet with my drive, the short test passed ok and it is 75% through the long test. Not sure if it performs any writes to disk, I am assuming it does otherwise it is not much use as a diagnostic tool,
Once that is done you'll want to backup any media/files that you don't want to lose!

Assuming the disk passes the tests, try a manual fsck on it - Boot from the CD, quit out of setup as soon as you get a chance and fsck /dev/hda1 and /dev/hda3 (substitute appropriate devices). Hopefully there's no physical issue with the drive.

When I want to really hit the drive I'll use fsck -cDkvy /dev/xxx. WARNING: this can be dangerous and cause you to lose files. It can also take a very long time, depending on the size of the filesystem.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 03, 2007 10:23 pm 
Offline
Joined: Fri Dec 22, 2006 3:00 pm
Posts: 158
I realise now that the PC case I used to build my MythTV box is very old and certainly pre-SATA and pre-Athlon. I have a modern PSU I am going to use to replace the old one, I don't think my current PSU is really up to the job. The new PSU was from my work computer and had to be replaced as it had an issue not powering up with some Asus motherboards, hopefully it will boot with my M2NPV.

Thanks for the tips on running fsck, I will let you know how I get on. Probably be a few days,

Kevin


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 108 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