MySQL Forums
Forum List  »  Connector/C++

Calling mysqldump from c++
Posted by: Rudo Pribis
Date: June 26, 2007 01:19AM

Hi I'm new here.
I have a problem with calling mysqldump from c++.
My code looks like this.

void main()
{
char szCmd[]="C:\\Program Files\\MySQL\\MySQL Server 5.0\\bib\\mysqldump.exe";
_spawnl(_P_WAIT, szCmd, "mysql > C:\\Temp\\tmp.sql");
DWORD err = GetLastError();
}

I get error 87, from GetLastError .
And in command window I get text:
-- MySQL dump 10.12
--
-- Host: localhost Database: >
-- ------------------------------------------------------
-- Server version 5.0.37-community-nt

/*!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
--
mysqldump: Got error: 1049: Unknown database '>' when selecting the database

Does someone know, what's going on here ? I am starting be little bit screwd from this.

Options: ReplyQuote


Subject
Views
Written By
Posted
Calling mysqldump from c++
6572
June 26, 2007 01:19AM
3418
July 12, 2007 12:51PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.