Convert .myd file to SQL Query?

This is a discussion on Convert .myd file to SQL Query? within the MySQL Database forums, part of the Database Forums category; A table in my MySQL database has become corrupted and I need to restore it from a backup. Unfortunately, the ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-03-2008
karljcox@gmail.com
 
Posts: n/a
Default Convert .myd file to SQL Query?

A table in my MySQL database has become corrupted and I need to
restore it from a backup. Unfortunately, the only backups my web host
provides are the actual database files (i.e. myd, frm and myi files).
I do not have root access to the web server, so I am not able to
restore my corrupted table using these files.

Is there a way to convert the myd file to a sql query? I have already
recreated the corrupted table's structure, but now need to be able to
restore the table's data and the only backup I have are these files.
Reply With Quote
  #2 (permalink)  
Old 01-03-2008
Rik Wasmus
 
Posts: n/a
Default Re: Convert .myd file to SQL Query?

On Thu, 03 Jan 2008 18:19:46 +0100, <karljcox@gmail.com> wrote:
> A table in my MySQL database has become corrupted and I need to
> restore it from a backup. Unfortunately, the only backups my web host
> provides are the actual database files (i.e. myd, frm and myi files).


And you promptly pointed out this was ridiculous offcourse.

> I do not have root access to the web server, so I am not able to
> restore my corrupted table using these files.


If they have a backup of those files, shouldn't they be able to put some
specific requested files back?

> Is there a way to convert the myd file to a sql query? I have already
> recreated the corrupted table's structure, but now need to be able to
> restore the table's data and the only backup I have are these files.


Afaik, no. Install the exact same MySQL version on a comparable computer,
copy the files to it, and pray it will understand them. Then you can run a
simple mysqldump.
--
Rik Wasmus
Reply With Quote
  #3 (permalink)  
Old 01-03-2008
karljcox@gmail.com
 
Posts: n/a
Default Re: Convert .myd file to SQL Query?

Rik - Thanks for the reply. Yeah, I did expressed to them how
rediculous the situation was. The only solution they offered was to
restore my _entire_ database back to one of my backups which is,
needless to say, very inconvenient as all of my other tables (the non-
corrupted ones) would then lose a weeks worth of data too.
Reply With Quote
  #4 (permalink)  
Old 01-03-2008
Peter H. Coffin
 
Posts: n/a
Default Re: Convert .myd file to SQL Query?

On Thu, 3 Jan 2008 09:44:43 -0800 (PST), karljcox@gmail.com wrote:
> Rik - Thanks for the reply. Yeah, I did expressed to them how
> rediculous the situation was. The only solution they offered was to
> restore my _entire_ database back to one of my backups which is,
> needless to say, very inconvenient as all of my other tables (the non-
> corrupted ones) would then lose a weeks worth of data too.


If they've got the entire database as a mysqldump output, it's not THAT
hard to lop off parts to restore just the tables you need. The output is
just giant, honkin' SQL commands, after all, and any good* text editor
should be able to manipulate it properly as plain text.

* For careful values of "good". WordPad doesn't qualify, for example.

--
I hate mornings. I know they hate me back, too.
-- Joel Gluth
Reply With Quote
  #5 (permalink)  
Old 01-03-2008
karljcox@gmail.com
 
Posts: n/a
Default Re: Convert .myd file to SQL Query?

Ok, I've got MySQL installed, and the .myd, .myi and .frm files copied
over but I am unable to get mysqldump to start. I'm running MySQL 5.0
- is mysqldump built in to MySQL or is this something that I will have
to download and install separately. I've done a bunch of searches but
can not prove either theory at this time.

This returns an error:

>mysqldump --help;


Reply With Quote
  #6 (permalink)  
Old 01-03-2008
karljcox@gmail.com
 
Posts: n/a
Default Re: Convert .myd file to SQL Query?

Oh yeah- I've got MySQL 5.0 installed on a fully patched Windows XP
Pro machine.
Reply With Quote
  #7 (permalink)  
Old 01-03-2008
Rik Wasmus
 
Posts: n/a
Default Re: Convert .myd file to SQL Query?

On Thu, 03 Jan 2008 20:37:43 +0100, <karljcox@gmail.com> wrote:

> Ok, I've got MySQL installed, and the .myd, .myi and .frm files copied
> over but I am unable to get mysqldump to start. I'm running MySQL 5.0
> - is mysqldump built in to MySQL or is this something that I will have
> to download and install separately. I've done a bunch of searches but
> can not prove either theory at this time.
>
> This returns an error:
>
>> mysqldump --help;


'an error' is quite harder to troubleshoot then 'I get _this_
error:<errormsg>'
--
Rik Wasmus
Reply With Quote
  #8 (permalink)  
Old 01-03-2008
Peter H. Coffin
 
Posts: n/a
Default Re: Convert .myd file to SQL Query?

On Thu, 03 Jan 2008 20:43:30 +0100, Rik Wasmus wrote:
> On Thu, 03 Jan 2008 20:37:43 +0100, <karljcox@gmail.com> wrote:
>
>> Ok, I've got MySQL installed, and the .myd, .myi and .frm files copied
>> over but I am unable to get mysqldump to start. I'm running MySQL 5.0
>> - is mysqldump built in to MySQL or is this something that I will have
>> to download and install separately. I've done a bunch of searches but
>> can not prove either theory at this time.
>>
>> This returns an error:
>>
>>> mysqldump --help;

>
> 'an error' is quite harder to troubleshoot then 'I get _this_
> error:<errormsg>'


There's strong odds on it being

ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'mysqldump --help' at line 1

though.

--
When you have a thermic lance, everything looks like hours of fun.
-- Christian Wagner in a.s.r
Reply With Quote
  #9 (permalink)  
Old 01-03-2008
karljcox@gmail.com
 
Posts: n/a
Default Re: Convert .myd file to SQL Query?

Sorry guys- yep Peter has it:

ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'mysqldump --help' at line 1

Reply With Quote
  #10 (permalink)  
Old 01-03-2008
Rik Wasmus
 
Posts: n/a
Default Re: Convert .myd file to SQL Query?

On Thu, 03 Jan 2008 22:27:40 +0100, <karljcox@gmail.com> wrote:

> Sorry guys- yep Peter has it:
>
> ERROR 1064 (42000): You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right
> syntax to use near 'mysqldump --help' at line 1


And that would be because mysqldump is run from the shell, not the mysql
prompt (i.e. it's not a query of some sorts, it's a program).
--
Rik Wasmus
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB 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 08:20 AM.


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