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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible to move dbase files?

Status
Not open for further replies.

pripley

Programmer
May 17, 2000
4
CA
Is there a way to transport a mysql database to another machine?<br><br>I ftp'd the database files over to the other machine.&nbsp;&nbsp;I was able to get into the database and &quot;show tables&quot; showed all the tables that were supposed to be there but when I tried to &quot;describe&quot; any of the tables it gives me:<br><br>ERROR:1016: Can't open file: compare_data.ISM (Errcode: 138)<br><br>However, I had changed the permissions on compare_data.ISM and all the other database files so anyone should be able to access them.<br><br>I'm running version 3.20.32A on machine the database is on and 3.21.19-beta on the machine I'm trying to move the database to.<br><br>Is this a version thing or can you not transport a database from one machine to another?<br><br>Thanks<br><br>P.Ripley
 
Probably a version thing. But the safe way to transport a database is to use mysqldump, which dumps the whole database into a text file composed of the SQL queries to create tables, and the INSERT queries to populate them.<br><br>to dump:<br><br>#mysqldump -u [user]-h [host] -p[password] [databasename] &gt;name_of_outputfile.txt<br><br>Then at the other end, run the opposite:<br><br>#mysql -u [user] -h [host] -p[password] &lt;name_of_outputfile.txt<br><br>(the -p[password] thing is not a type, the password needs to have NO spaces after -p. But, you can just use -p without entering the password, to be prompted for it by the terminal)
 
It worked.&nbsp;&nbsp;Thanks. <br><br>However, I first had to go into mysql to create the database before running the database text file.&nbsp;&nbsp;Then it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top