Avatar of egxis
egxis

asked on 

mysqldump not writing data to target database

I'm using MySQL dump 10.13  Distrib 5.1.37, for Win32 (ia32) to transfer data to a host, however it is not working.
No data is written, I just get a generic message, claiming the dump was successful, when in fact it was not.

I can take exactly the same dump code, insert it into myphpmyadmin, for example, and it works perfectly!

What's wrong?

mysqldump.exe -h localhost -u user -p mydb > mydb.sql
 
 
 
mysqldump.exe -h hostname -u user -p mynewdb < countries.sql
 
-- MySQL dump 10.13  Distrib 5.1.37, for Win32 (ia32)
--
-- Host: hostname                       Database: mynewdb
-- ------------------------------------------------------
-- Server version       5.0.67.d7-ourdelta-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 */;
 
--
-- Not dumping tablespaces as no INFORMATION_SCHEMA.FILES table on this server
--
/*!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 2009-10-02 16:06:02

Open in new window

20091001-countries.txt
MySQL Server

Avatar of undefined
Last Comment
gk37
Avatar of Umesh
Umesh
Flag of India image

Below command is okay for taking a dump..
#mysqldump.exe -h localhost -u user -p mydb > mydb.sql
 
 Are you trying to restore? or want to take dump?

#mysqldump.exe -h hostname -u user -p mynewdb < countries.sql

Try this for restoring use below command

mysql.exe -h hostname -u user -p mynewdb < countries.sql

ASKER CERTIFIED SOLUTION
Avatar of Umesh
Umesh
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of gk37
gk37
Flag of India image

You could also try using the MySQL GUI Tools and connect to the host using the Administrator tools. You can then Restore the dump.

You may need to Check 'Ignore Errors' options to ensure it gets restored.
MySQL Server
MySQL Server

MySQL is an open source, relational database management system that runs as a server providing multi-user access to a number of databases. Acquired by Oracle in 2009, it is frequently used in combination with PHP installations, powering most of the WordPress installations.

49K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo