recovering frome a server crash

This is a discussion on recovering frome a server crash within the MySQL Database forums, part of the Database Forums category; you knwo the one about those who keep backupsand those who have never had a HD crash? Guess which group ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-02-2006
pdc124@yahoo.co.uk
 
Posts: n/a
Default recovering frome a server crash

you knwo the one about those who keep backupsand those who have never
had a HD crash?
Guess which group im now in ?

i cant start the MySQL server from the crashed machine , but ive
retrived the stuff in /var/lib/mysql/....

Ive copied the directory across to a new machine but now have this ,
logged in a root on the new machine.

mysql> REPAIR TABLE trachy;
+------------+--------+----------+-----------------------------+
| Table | Op | Msg_type | Msg_text |
+------------+--------+----------+-----------------------------+
| OR2.trachy | repair | error | Table 'trachy' is read only |
+------------+--------+----------+-----------------------------+
1 row in set (0.00 sec)

mysql> SHOW GRANTS ;
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost
|
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY
PASSWORD '*xxx' WITH GRANT OPTION |
+----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> REPAIR TABLE trachy;
+------------+--------+----------+-----------------------------+
| Table | Op | Msg_type | Msg_text |
+------------+--------+----------+-----------------------------+
| OR2.trachy | repair | error | Table 'trachy' is read only |
+------------+--------+----------+-----------------------------+
1 row in set (0.00 sec)

have I missed something ?

Reply With Quote
  #2 (permalink)  
Old 11-02-2006
Axel Schwenke
 
Posts: n/a
Default Re: recovering frome a server crash

"pdc124@yahoo.co.uk" <pdc124@yahoo.co.uk> wrote:
>
> Ive copied the directory across to a new machine but now have this,
> logged in a root on the new machine.
>
> mysql> REPAIR TABLE trachy;
> +------------+--------+----------+-----------------------------+
>| Table | Op | Msg_type | Msg_text |
> +------------+--------+----------+-----------------------------+
>| OR2.trachy | repair | error | Table 'trachy' is read only |
> +------------+--------+----------+-----------------------------+
>
> have I missed something ?


Sure. A MyISAM table is 3 files on disk: $TABLENAME.{frm,MYD,MYI}.
Those files must be owned and writable by the user that mysqld is
running as (usually: mysql).


XL
--
Axel Schwenke, Senior Software Developer, MySQL AB

Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
MySQL User Forums: http://forums.mysql.com/
Reply With Quote
  #3 (permalink)  
Old 11-02-2006
pdc124@yahoo.co.uk
 
Posts: n/a
Default Re: recovering frome a server crash

?
>
> Sure. A MyISAM table is 3 files on disk: $TABLENAME.{frm,MYD,MYI}.
> Those files must be owned and writable by the user that mysqld is
> running as (usually: mysql).
>


nervada OR2 # ls -la |grep trach
-rw-r--r-- 1 mysql mysql 1265 Aug 21 09:48 trachy.MYD
-rw-r--r-- 1 mysql mysql 2048 Aug 21 23:30 trachy.MYI
-rw-r--r-- 1 mysql mysql 8620 Aug 6 2005 trachy.frm
nervada OR2 #
same problem when i try and repair the table

Reply With Quote
  #4 (permalink)  
Old 11-02-2006
Radoulov, Dimitre
 
Posts: n/a
Default Re: recovering frome a server crash

>> Sure. A MyISAM table is 3 files on disk: $TABLENAME.{frm,MYD,MYI}.
>> Those files must be owned and writable by the user that mysqld is
>> running as (usually: mysql).
>>

>
> nervada OR2 # ls -la |grep trach
> -rw-r--r-- 1 mysql mysql 1265 Aug 21 09:48 trachy.MYD
> -rw-r--r-- 1 mysql mysql 2048 Aug 21 23:30 trachy.MYI
> -rw-r--r-- 1 mysql mysql 8620 Aug 6 2005 trachy.frm
> nervada OR2 #
> same problem when i try and repair the table


What's the output of the ls -ld of the upper directory ( ls -ld
.../<up_dir> )


Regards
Dimitre


Reply With Quote
  #5 (permalink)  
Old 11-02-2006
pdc124@yahoo.co.uk
 
Posts: n/a
Default Re: recovering frome a server crash

nervada mysql # ls -la
total 26052
drwxr-x--- 7 mysql mysql 608 Nov 2 12:41 .
OR2 and ccmds are the 2 DBs ive copied in ( this is an old machine that
has been resurrected for an emergency

drwxr-xr-x 20 root root 496 Nov 1 15:05 ..
-rw-r--r-- 1 mysql mysql 0 Oct 31 19:22 .keep
drwxr-xr-x 2 mysql mysql 5832 Nov 1 13:28 OR2
drwxr-xr-x 2 root root 5832 Nov 2 10:21 OR2-backup
drwxr-xr-x 2 root root 1440 Nov 1 13:27 ccmds
-rw-rw---- 1 mysql mysql 5242880 Nov 2 12:41 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 Nov 1 12:36 ib_logfile1
-rw-rw---- 1 mysql mysql 10485760 Nov 2 12:41 ibdata1
drwx------ 2 mysql mysql 1584 Nov 1 12:34 mysql
-rw-rw---- 1 mysql mysql 10063 Nov 1 12:34 nervada-bin.000001
-rw-rw---- 1 mysql mysql 376852 Nov 1 12:34 nervada-bin.000002
-rw-rw---- 1 mysql mysql 5249529 Nov 1 12:34 nervada-bin.000003
-rw-rw---- 1 mysql mysql 79 Nov 1 12:36 nervada-bin.000004
-rw-rw---- 1 mysql mysql 79 Nov 2 10:28 nervada-bin.000005
-rw-rw---- 1 mysql mysql 998 Nov 2 12:40 nervada-bin.000006
-rw-rw---- 1 mysql mysql 953 Nov 2 15:43 nervada-bin.000007
-rw-rw---- 1 mysql mysql 147 Nov 2 12:41 nervada-bin.index
drwx------ 2 mysql mysql 48 Nov 1 12:34 test
nervada mysql # ls -ld
drwxr-x--- 7 mysql mysql 608 Nov 2 12:41 .
nervada mysql #

Reply With Quote
  #6 (permalink)  
Old 11-02-2006
Axel Schwenke
 
Posts: n/a
Default Re: recovering frome a server crash

"pdc124@yahoo.co.uk" <pdc124@yahoo.co.uk> wrote:

>> Sure. A MyISAM table is 3 files on disk: $TABLENAME.{frm,MYD,MYI}.
>> Those files must be owned and writable by the user that mysqld is
>> running as (usually: mysql).

>
> nervada OR2 # ls -la |grep trach
> -rw-r--r-- 1 mysql mysql 1265 Aug 21 09:48 trachy.MYD
> -rw-r--r-- 1 mysql mysql 2048 Aug 21 23:30 trachy.MYI
> -rw-r--r-- 1 mysql mysql 8620 Aug 6 2005 trachy.frm
> nervada OR2 #
> same problem when i try and repair the table


Hmm. Strange.

How about the directory where those files live? Normal REPAIR
(that is: not using the QUICK option) creates a temporary file.

How about other processes? Another mysqld or myisamchk running?


XL
--
Axel Schwenke, Senior Software Developer, MySQL AB

Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
MySQL User Forums: http://forums.mysql.com/
Reply With Quote
  #7 (permalink)  
Old 11-02-2006
Radoulov, Dimitre
 
Posts: n/a
Default Re: recovering frome a server crash


> nervada mysql # ls -la
> total 26052
> drwxr-x--- 7 mysql mysql 608 Nov 2 12:41 .
> OR2 and ccmds are the 2 DBs ive copied in ( this is an old machine that
> has been resurrected for an emergency
>
> drwxr-xr-x 20 root root 496 Nov 1 15:05 ..
> -rw-r--r-- 1 mysql mysql 0 Oct 31 19:22 .keep
> drwxr-xr-x 2 mysql mysql 5832 Nov 1 13:28 OR2
> drwxr-xr-x 2 root root 5832 Nov 2 10:21 OR2-backup
> drwxr-xr-x 2 root root 1440 Nov 1 13:27 ccmds
> -rw-rw---- 1 mysql mysql 5242880 Nov 2 12:41 ib_logfile0
> -rw-rw---- 1 mysql mysql 5242880 Nov 1 12:36 ib_logfile1
> -rw-rw---- 1 mysql mysql 10485760 Nov 2 12:41 ibdata1
> drwx------ 2 mysql mysql 1584 Nov 1 12:34 mysql
> -rw-rw---- 1 mysql mysql 10063 Nov 1 12:34 nervada-bin.000001
> -rw-rw---- 1 mysql mysql 376852 Nov 1 12:34 nervada-bin.000002
> -rw-rw---- 1 mysql mysql 5249529 Nov 1 12:34 nervada-bin.000003
> -rw-rw---- 1 mysql mysql 79 Nov 1 12:36 nervada-bin.000004
> -rw-rw---- 1 mysql mysql 79 Nov 2 10:28 nervada-bin.000005
> -rw-rw---- 1 mysql mysql 998 Nov 2 12:40 nervada-bin.000006
> -rw-rw---- 1 mysql mysql 953 Nov 2 15:43 nervada-bin.000007
> -rw-rw---- 1 mysql mysql 147 Nov 2 12:41 nervada-bin.index
> drwx------ 2 mysql mysql 48 Nov 1 12:34 test
> nervada mysql # ls -ld
> drwxr-x--- 7 mysql mysql 608 Nov 2 12:41 .
> nervada mysql #


The upper ( .. ) and ccmds are root:root:

> drwxr-xr-x 20 root root 496 Nov 1 15:05 ..


Try to change the owner, for example, if it's /var/lib/mysql:

chown -R mysql:mysql /var/lib/mysql


Regards
Dimitre





Reply With Quote
  #8 (permalink)  
Old 11-02-2006
Radoulov, Dimitre
 
Posts: n/a
Default Re: recovering frome a server crash


>> drwxr-xr-x 20 root root 496 Nov 1 15:05 ..

>
> Try to change the owner, for example, if it's /var/lib/mysql:
>
> chown -R mysql:mysql /var/lib/mysql


.... and restart mysql.


Dimitre


Reply With Quote
  #9 (permalink)  
Old 11-02-2006
pdc124@yahoo.co.uk
 
Posts: n/a
Default Re: recovering frome a server crash

ive changed the permissions of /var/lib/mysql .Same thing
nervada lib # ls -la |grep my
drwxr-x--- 7 mysql mysql 608 Nov 2 12:41 mysql
nervada lib # ps -A |grep my
30713 ? 00:00:00 mysqld
nervada lib #

Reply With Quote
  #10 (permalink)  
Old 11-02-2006
pdc124@yahoo.co.uk
 
Posts: n/a
Default Re: recovering frome a server crash

and fixed once mysql was restarted
thanks for the help

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:21 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0