Question

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?

Was it helpful?

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?

OTHER TIPS

The folder with the name of your database, lets call it mydatabase should be copied to \wamp\bin\mysql\mysqlx.y.z\data\mydatabase

Dont copy any other folders, only the ones with the names of the databases you actually created yourself.

If the MySQL version is the same as the one you used to create the database this should work just fine. It may work if the versions differ by a little, but if the versions are very different it probably wont work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top