Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy a database from old WAMP installation folder to another

Tags:

mysql

wamp

I just install a fresh copy of WAMP, and I want to import couple of databases from the old one to the new one, so I entered to the old mysql data directory C:\wamp-old\bin\mysql\mysql5.7.14\data, and copy the relevant databases there to the new data directory. But when I try to access the tables in phpmyadmin, I get a message saying that the tables aren't exists, but they do: enter image description here

What am I missing?

like image 532
Avishay28 Avatar asked Dec 25 '16 10:12

Avishay28


People also ask

Where are databases stored in Wamp?

On my system, they are in C:\Program Files (x86)\WampServer\bin\mysql\mysql5. 1.53\data . So in yours they would be in E:\wamp\bin\mysql\mysql-version\data . You can start mysql locally from E:\wamp\bin\mysql\mysql-version\bin , where all the executables are.

How do I reinstall Wamp without losing database?

And when you have reinstall the wamp server just rename the "data-old" folder to "data" In this way you will not lose your database.


2 Answers

You forgot to copy the ibdata file. enter image description here

like image 60
Mwangi Thiga Avatar answered Nov 09 '22 06:11

Mwangi Thiga


I did it successfully just now:

  1. make a copy of wamp folder (wamp-old)
  2. uninstall the wamp
  3. install the new wamp (overwrite all the files if u were asked)
  4. start the wamp
  5. ck the localhost and phpmyadmin
  6. copy your databases from the old-wamp only from C:\wamp-old\bin\mysql\mysql5.7.14\data and paste to the same location in new wamp
  7. then copy and paste ibdata file from the above path and replace in new one.

You are done!

like image 32
Ravi Bhadauria Avatar answered Nov 09 '22 06:11

Ravi Bhadauria