Search code examples
mysqlphpmyadminxamppwamp

Migrate mysql db from XAMPP to WAMP


I built a sql database using phpmyadmin in xampp. I'm now switching to wamp. To transfer the db I copied the db files from xampp, located in xampp//... mysql/data// and pasted them to the wamp//... mysql/data//. However, the data tables do not appear when I run phpmyadmin from wamp.

I would export the databases from the xampp-phpmyadmin directly into wamp-phpmyadmin, but I've uninstalled xampp and no longer have the source files, other than what was located in xampp//... mysql/data//.

Am I missing a step here?


Solution

  • This is not the recommended way to copy database files. It may work (which is why you sometimes see people recommending it), it may sort of work (requiring you to reset permissions), or it may completely fail to copy any of your data over. A much more robust means to transfer the database is to do an SQL export from the old server then import it to the new server. Since you got rid of the old installation, we'll move past that point quickly, but to be clear there are no promises it will work.

    Based on what you've already done, my first guess is that your user doesn't have permission on the new database. Are you logged in as the root user or another user with administrative privileges?

    When you say you copied the db files, do you mean you copied the folder (with the same or similar name as your database) and all files inside that folder? Please check the file system permissions of that folder and the files within to make sure they match the permissions and owner/group of the other MySQL data files. Do you know what table type the tables were?