Databases :: MySql :: Importing tables |
|||
| By: dkalafus |
Date: 05/11/2004 00:00:00 |
Points: 125 | Status: Answered Quality : Excellent |
|
I have some files for tables (.MYD, .MYI, and .frm files) from a Win2K database which I want to bring into my Unix MySQL database. Is it sufficient to copy these files into the appropriate database file directory? (I want to add the tables to the existing tables in that database.) If it matters, I can ensure that this particular DB won't be in use when the files are copied. |
|||
| By: girish_nair | Date: 05/11/2004 10:59:00 | Type : Comment |
|
| Yes, it is possible with the MyISAM tables. You can use the mysqldump instead! |
|||
| By: VGR | Date: 05/11/2004 16:27:00 | Type : Comment |
|
| yes, if it's a x86 processor or indian-order-compatible proc Please note that you ***also*** have to : -either create the same DB&table layout so that mysqld knows them beforehand ; then stop server, copy the MYI, MYD and FRM files and restart server. -or also copy mysql/* files too (system files) ; this is usable only if you accept that the second server be a clone of the first one. |
|||
| By: harwantgrewal | Date: 06/11/2004 22:35:00 | Type : Comment |
|
| Cant you export these table into a sql file from PHPmyadmin? Harry |
|||
| By: VGR | Date: 06/11/2004 22:46:00 | Type : Comment |
|
| yes Harry, but why complicate matters ? |
|||
| By: dkalafus | Date: 06/11/2004 23:44:00 | Type : Comment |
|
| Actually, the problem is that I don't know the structure of the tables I'm importing; I don't have access to the original database - just the .MYD, .MYI, and .frm files. Otherwise I'd use mysqldump. I could create a new database for these files, or add them to an existing DB; either would be fine. VGR: Would it work to stop the server, copy the files into an existing DB's directory (alongside its current files) and then restart the server? |
|||
| By: VGR | Date: 07/11/2004 00:49:00 | Type : Answer |
|
| ok, then the best solution is : -create a new database -try to recreate a compatible table layout by looking at the original FRMs with a text editor. At the end you'll see something like : ˙id˙first_name˙last_name˙username˙password˙team1˙team2˙team3˙team4˙team5˙total_points˙ where you can easily see the columns names : id, first_name, last_name, etc -then issue a CREATE TABLE() statement and use char(255)for all fields as a first try -stop server (1) -copy the FRM,MYD,MYI it just created or rename them -overwrite with original files -restart server -check data in table -adjust layout using ALTER TABLE and/or copy again starting at step(1) |
|||
|
Do register to be able to answer |
|||
İ2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








