MynaG's Bits n Bytes

26 Aug, 2011

Move/Transfer/Copy MYSQL database from one PC to another in Windows

Posted by: mynag In: Computer|Solution & tips

The standard way to copy one database from one computer to another will be to backup using MSQL administrator from the source computer and then restore them onto the destination computer using the similar tool. However, if you have 10 or more databases to transfer, that will be pretty troublesome, isn’t it? There’s another situation where you can use the following method for transferring the database especially when your source computer is already dead and you only have a working harddisk with the MYSQL databases in it.

So here, I am going to show you how to move, transfer or copy MYSQL databases from one computer to another in Windows in the quickest way. The only requirement is that you have to be an administrator, so that you can access Document and Settings folder or the Program Files folder.

  1. Open Window Explorer (Windows Key + E) or Open My Computer at the source computer
  2. Depending on where you have set your data folder during the MYSQL installation, you will have to go that same location. If you do not know where it is, read How to find MYSQL database files in Windows.
  3. Once you located the data folder, you see one or more folders named after your database name.  Copy all the folders and the ibdata1 file. DO NOT COPY THE ib_logfile(x) files and anything else!
  4. Go over to the target computer, Open System Services. (Type services.msc at the Windows menu “Search Program and files” entry box and press <ENTER>)
  5. On the right panel of the Services window, scroll along the list and look for the name “MYSQL“. Select MYSQL and right mouse click and click <STOP>. Once it has stopped, you will it’s status become blank instead of <Started>.
  6. Similarly look for the location of the data folder. Once you located it, I recommend you back up the folder or just rename it. Paste over the folders and ibdata file you have copied from the source computer to the data folder. Overwrite all files or folders when prompt.
  7. Go back to the Services window and select back MYSQL. Right mouse click on it and click <Start> to resume the MYSQL service.
  8. Open MYSQL administrator and log on to your database server and you should be able to see your transferred database together with their data.

2 Responses to "Move/Transfer/Copy MYSQL database from one PC to another in Windows"

1 | agnes

January 6th, 2013 at 8:35 am

Avatar

im able to copy the databases but the contents of the tables are not coming along with the databases.it showing me the error as “databasename.tablename doesnt exist”
plz help me …….

2 | sanket prabhune

February 8th, 2013 at 3:48 pm

Avatar

i m also having the same problem. database is getting copied but its tables are not. what to do now?

Comment Form