MySQL Forums
Forum List  »  Backup

mysqldump failing when dump routines if database name contains special characters
Posted by: Ravi Thati
Date: October 16, 2012 06:49AM

I have a database with name ';havesinglequotes' (single quote at begin and end + a semicolon in it).

when I dump the database with below command it fails with error 1049 while dumping routines.

mysqldump --single-transaction --flush-logs --master-data=2 --create-options -B --default-character-set=utf8 --routines --max_allowed_packet=41943040 -u root --socket=/tmp/mysql.sock "';havesinglequotes'" -p
Enter password:
-- MySQL dump 10.13 Distrib 5.5.27, for linux2.6 (x86_64)
--
-- Host: localhost Database: ';havesinglequotes'
-- ------------------------------------------------------
-- Server version 5.5.27-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 */;

--
-- Position to start replication or point-in-time recovery from
--

-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000093', MASTER_LOG_POS=107;

--
-- Current Database: `';havesinglequotes'`
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ `';havesinglequotes'` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `';havesinglequotes'`;

--
-- Table structure for table `tb1`
--

DROP TABLE IF EXISTS `tb1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tb1` (
`i` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tb1`
--

LOCK TABLES `tb1` WRITE;
/*!40000 ALTER TABLE `tb1` DISABLE KEYS */;
INSERT INTO `tb1` VALUES (2);
/*!40000 ALTER TABLE `tb1` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Dumping routines for database '';havesinglequotes''
--
mysqldump: Couldn't execute 'use `\';havesinglequotes\'`': Unknown database '\';havesinglequotes\'' (1049)




Could anyone advice how to resolve this?

Thanks in advance.
Ravi.

Options: ReplyQuote


Subject
Views
Written By
Posted
mysqldump failing when dump routines if database name contains special characters
2917
October 16, 2012 06:49AM


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.