Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have copied the web db directory(/var/lib/mysql/data/web/), when mysql is not running. I transferred this directory to another machine, where mysql is running.

web db's stuff is myisam based.

I am thinking about how to restore this on a different server. The strategy I have on my mind is the following.

  1. copy the data directory of web db to the new server.
  2. on new server, 'create database web', which creates a directory in /var/lib/mysql/data
  3. copy all files from the step to the new directory created in 2.
  4. bounce mysql

My question: how to deal with information_schema for this new db?

share|improve this question
    
Are you running the same version of mysqld on both servers? Any reason doing a mysqldump isn't an option? –  andol Apr 2 '10 at 6:30
    
800GB database, thats why. Since I have a copy of that directory, i am trying to find an easy way. –  RainDoctor Apr 2 '10 at 8:09

2 Answers 2

on your source machine:

mysqldump -q -u username -p database > database.sql

transfer database.sql to the destination machine and do:

mysql -u username -p database < database.sql
share|improve this answer
    
this is 800GB myisam db. So, I copied the directory of all these tables. sqldump is not an option –  RainDoctor Apr 2 '10 at 8:06

information_schema is the information database where the information about all the other databases is kept. It is a built-in virtual database with the sole purpose of providing information about the database system itself. The MySQL server automatically populates the tables in the information_schema.

reference: http://kb.siteground.com/article/What_is_the_information_schema_database.html

So if its myisam tables only, you can copy / move database around as long as the mysql versions are same.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.