files for tablespace
Posted by: ct_privy (---.hfc.comcastbusiness.net)
Date: December 26, 2009 08:30PM

I inadvertently deleted some files I needed to access four tables I created with the innoDB storage engine. I can open the database in myphpadmin, but I cannot access the tables in myphpadmin even though there is a (4) next to the database name on the lelft side indicating the four tables. In the [C:\wamp\bin\mysql\mysql5.1.30\data] folder I have the .frm files, an ibdata file, and INDEX file, and two logfiles, I just need to know what other files I need to get, how I would go about getting them, and which path to place them in, so that I might be able to access the tables in myphpadmin once again.

I appreciate any constructive suggestions.

And happy holidays.

Options: ReplyQuote
Re: files for tablespace
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: December 26, 2009 09:28PM

check ur recycle bin... unforutunly ibdata files are very complex.. they store the data for all the tables and the .frm files are the structure of the table

in the database named folder u need also

.myd .myi a db.opt



and in the data folder u need
ib_log file

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: files for tablespace
Posted by: ct_privy (---.hfc.comcastbusiness.net)
Date: December 26, 2009 09:52PM

it looks like .myd and .myi files are the ones I am missing. they are not in my recycle bin. is there a way to work around this?

(the db.opt is 1KB and the .frm files are 9KB and all located in the database-named folder).

Thanks.

Options: ReplyQuote
Re: files for tablespace
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: December 26, 2009 10:00PM

if you have all the other ones then ur set up as innodb engine which doesnt have .myi and .myd


that means ur not missing any files (only MyISAM use those other two files)


are you connecting as the right user for that db? and did u ever move the files from one version of mysql to another?

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: files for tablespace
Posted by: ct_privy (---.hfc.comcastbusiness.net)
Date: December 26, 2009 10:13PM

yes, I am the right user for that db.

I did install another version of MySQL5.0 previously, and what I did do was take the tablename folders from the 5.0 version and copy them into the 5.1.30 version that I was using. I did this after I noticed that the 5.1.30 folder did not have the tablename folders with the .frm and db.opt files.

The version that I work from is 5.1.30 (that was installed with WAMP). But the 5.0 version also had the tablename folders. I'm not sure why this is.

Options: ReplyQuote
Re: files for tablespace
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: December 26, 2009 10:16PM

one may be setup using innodb and the other myisam


you cannot move innodb files like this


you have to export the db and reimport them


if you can put it back exactly how it was you shud be able to get it working again but u need it EXACTLY how it was..


same orginal version of mysql and same ibdata files

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: files for tablespace
Posted by: ct_privy (---.hfc.comcastbusiness.net)
Date: December 26, 2009 10:31PM

ok, I understand that I should put the tablename folders back to the original version of MySQL (ver 5.0) that they came from, but that means that I will not have tablename folders (with the .frm files and db.opt) in the data folder of the MySQL (ver 5.1.30) that I work from.

you say I "have to export the db and reimport them". will exporting and reimporting the db recover the missing folders/files? where do I export to? and do I reimport the db or the folders?

Options: ReplyQuote
Re: files for tablespace
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: December 26, 2009 10:47PM

there is no missing file

when mysql is using the innodb engine


data and structure are kept seperatly

when you created the db in 5.0 the data was kept in data/ibdata file


you then moved the the structure only data\databasename folder into a new mysql version which is why the database shows up but is not usable (no data)


the data is still in the ibdata file in 5.0 . but you cannot just move innodb databases in the way that you did.


you must move the database folder you moved, back into 5.0 and run that version of mysql

export the db using mysql export function and ul end up with a .sql file


then you can load up 5.1.3 and import using the import function..



ALSO - you cannot get the data from the ibdata file by hand, its very complexly written for speed and table linking

---------------------------------------------------------------------------------------------
ILL SAY AGAIN- you cannot move innodb db , they must be exported,, you can ONLY do his with MYISAM databases as the data for these is kept in the MYI and MYD files inside the db folder

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.