Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mySQL: install and attaching Databases

Status
Not open for further replies.

jkb17

Programmer
Nov 27, 2000
156
US
Hello.

I'm an experienced MS SQL Server DBA. however, I'm new to mySQL. I have been asked to take a look at a company's system designed in mySQL.

They want me to install mySQL on a new server. I guess I can find that at I believe the server is windows 2000.

They do have existing database files. I am going to have to move them over and "attach the files" to new databases.

I'm sorry if I'm using hte MS specific DB terms (not sure if logic is same).

Can anyone give me advice on bringing mySQL database files re-connected to the mySQL DBMS engine?

thanks in advance

Jim
 
Hi,

I know what you mean with sqlserver attach, you can probabbly do the same thing with mysql as the tables map 1:1 to real files all in the same directory. Best bet I think would be to create dummy tables and overwrite them with the "real" files.
I'm probabbly totaly off here !! I'm sure someone will help you out.
You'll find mysql a bit restrictive after sqlserver but it is FASTTTTTT
Of course you could always unload the tables from sqlserver and reload or use the remote server facility in sqlserver and atache via odbc to the new mysql db and copy over that way.
Lots of ways as with most things have a go !

kr
 
Thanks for tips.

I'm at a loss for words here. I know that there are multiple files. From sleipnir214 response, I assume 1 database has multiple files and these files are the exact table files.

I don't know what the system looks like yet and will find out on Monday.

So, I have to create the dummy database, create each of the individual tables and then over-write them with real files?

This client had a falling out with thier developer and they are stuck. The DBMS (mySQL) is down but the files are there.

My job is to bring it back to life. I've had to do this in MS SQL Server a bunch of times.

If you were to move a database off of server a and recreate it on server b and all you had were the files: How would you do that?

thanks all for the tips

Jim
 
Let's start again.

When you instruct MysQL to create a database, MySQL creates a new directory on the filesystem. When you create a table in that database, MySQL creates one or more files in that database's directory.

If you have a set of MySQL database files (one or more directories with table files in those directories), then it may be possible to just create new databases (allowing MySQL to create the filesystem directory) and then to dump the table files into the appropriate new database directory on the filesystem.

This is all predicated on the following assumptions:[ul][li]That the database files in question were originally created by an installation of MySQL[/li][li]that the MySQL-created database files in question were created on the same type of OS as the OS in which they are being installed (for example, there have been problems reported moving Linux-based MySQL files to a Win32-based MySQL database store).[/li][li]that permissions are set correctly on the newly-dumped table files[/li][/ul]

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Thanks, sleipnir214!

I believe all of your assumptions are correct. I will confirm (if possible) but I'm 99% certain that these database files were created in mySQL in windows environment but the mySQL system.

My friend suggested that I could just copy and paste the files in and I guess that's the case.

I'll try that and I'll look up on mysql.com so that i don't go in there totally blind!

any other links or resources to review other then mysql.com?

thanks a bunch

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top