I;m trying to move a database created with WAMP from one computer to another. I've exported it as a .sql file and imported it by creating a new database and then importing into it. The problem I'm facing with this approach is that none of the data in the tables gets imported and I haven't been able to figure out how to get both the database structure AND its data.

Recommended Answers

All 6 Replies

How exactly did you export and import it and what error message do you get? Use mysqldump for export and the mysql command line interface for import. Make sure that the mysql user account on the import side has the right to create tables.

no errors or anything, I went through myphpadmin and used the export option. I just hit okay at the prompt I didn't make any changes. And to import did much the same but to get it to work I had to create a database first and them import the .sql file. It works, all the tables are imported but none of the data.

Like I said: use mysqldump and the mysql command line. That way you'll get a clean database dump and all error messages.

nmv figured it out, onto importing to see if that works

all righty having gone through this is what I get

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Dee>cd C:\wamp\bin\mysql\mysql5.5.8\bin

C:\wamp\bin\mysql\mysql5.5.8\bin>mysqldump -uroot -p bookcatalogue > bookcatalog
ue.sql
Enter password:

C:\wamp\bin\mysql\mysql5.5.8\bin>mysqldump -uroot -p testCopy < bookcatalogue.sq
l
Enter password:
-- MySQL dump 10.13  Distrib 5.5.8, for Win32 (x86)
--
-- Host: localhost    Database: testCopy
-- ------------------------------------------------------
-- Server version       5.5.8-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2011-05-12  9:43:22

C:\wamp\bin\mysql\mysql5.5.8\bin>

However; the testcopy database is still empty according to the SQL console

Do not feed bookcatalogue.sql to mysqldump but to mysql:

mysql -uroot -p testCopy < bookcatalogue.sql

awesome thanks, clearly I miss read something earlier on that tutorial.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.