MySQL 5.5 changing data folder
Posted: 14 Jul 2011, 8:08am - Thursday

Today, I'm having problem with my MySQL. I bought new computer and want to transfer my databases from my old PC (using winXP) to new PC which is using windows 7. When I copied all my databases from data folder from my old computer and paste it to my new PC at "C:\Program Files\MySQL\MySQL Server 5.5\Data", and restart the MySQL, I can't see my databases. I found a solution from www.fossplanet.com and here's the step (I slightly modified the step since i have different problem...)

  1. create folder in "C:\MySQLData"
  2. copy all files from "C:\Users\All Users\MySQL\MySQL Server 5.5\data" to "C:\MySQLData"
  3. go to RUN and type services.msc and stop MySQL service
  4. at "C:\Program Files\MySQL\MySQL Server 5.5" -- edit the my.ini and change the datadir value to your new MySQL data folder which is "C:/MySQLData/"
  5. after changing the datadir, at Services window (services.msc) start again your MySQL
  6. then cast command in MySQL CLI "show databases" and you should get your migrated databases showing... :)
  ------------------- thanks to: Rolando A. Edwards MySQL DBA (SCMDBA)