Unix Technical Forum

mysqldump quotes in MySQL 5.0.26

This is a discussion on mysqldump quotes in MySQL 5.0.26 within the MySQL General forum forums, part of the MySQL category; --> Hi, I have 2 identical Linux machines setup with identical my.cnf files (except for server-id) and both running 5.0.26. ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 09:32 PM
Ian Collins
 
Posts: n/a
Default mysqldump quotes in MySQL 5.0.26

Hi,
I have 2 identical Linux machines setup with identical my.cnf files
(except for server-id) and both running 5.0.26.

On server A, I run,

mysqldump -h localhost -u root -p... --single-transaction --flush-logs
--delete-master-logs --master-data=1 --databases db1 db2 > dumpfile

I copy dumpfile to server B
and extract with,

mysqladmin -u root -p... create db1
mysqladmin -u root -p... create db2

cat dumpfile | mysql -u root -p...

I get the error,

ERROR 1049 at line 25: Unknown database '`db1`'

Note the backticks around the database name.
Looking at dumpfile, I see,

use `db1`

I tried doing the mysqldump with --compatible=ansi which changes the
backticks to double quotes, but get the same error,

ERROR 1049 at line 25: Unknown database '"db1"'.

I can't edit dumpfile as it is 8Gb (ok, I can split it and stuff like
that ... but come on!!)

What am I missing here? Has anyone else seen this?

Regards,
Ian Collins.



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 09:32 PM
Dan Buettner
 
Posts: n/a
Default Re: mysqldump quotes in MySQL 5.0.26

Ian, those backticks are standard stuff for mysqldump.

A couple of thoughts -
1, are you sure your 'create database' succeeds?
2, long shot, but are you FTPing in ASCII mode? This *might* mess up
the backtick character.
3, instead of cat file.sql | mysql, try this
mysql -u root -p < file.sql

HTH,
Dan


On 10/11/06, Ian Collins <ian.collins@kiwiplan.co.nz> wrote:
> Hi,
> I have 2 identical Linux machines setup with identical my.cnf files
> (except for server-id) and both running 5.0.26.
>
> On server A, I run,
>
> mysqldump -h localhost -u root -p... --single-transaction --flush-logs
> --delete-master-logs --master-data=1 --databases db1 db2 > dumpfile
>
> I copy dumpfile to server B
> and extract with,
>
> mysqladmin -u root -p... create db1
> mysqladmin -u root -p... create db2
>
> cat dumpfile | mysql -u root -p...
>
> I get the error,
>
> ERROR 1049 at line 25: Unknown database '`db1`'
>
> Note the backticks around the database name.
> Looking at dumpfile, I see,
>
> use `db1`
>
> I tried doing the mysqldump with --compatible=ansi which changes the
> backticks to double quotes, but get the same error,
>
> ERROR 1049 at line 25: Unknown database '"db1"'.
>
> I can't edit dumpfile as it is 8Gb (ok, I can split it and stuff like
> that ... but come on!!)
>
> What am I missing here? Has anyone else seen this?
>
> Regards,
> Ian Collins.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 09:32 PM
Ian Collins
 
Posts: n/a
Default Re: mysqldump quotes in MySQL 5.0.26

Hi,
yes, the create database succeeds. It's in a show databases. The error
message is complaining about "`db1`" (i.e. quotes followed by backtick).
I'm actually using rsync to copy the file (faster than ftp for some
reason). But it also failed when I originally ftp'd it.
I've also tried the mysql -u root -p < file.sql as well with no difference.

I actually got the database in by doing a "split -b 10000000 dumpfile"
as I can edit a 10Mb file, but not a 10Gb one - and then joining them
back together - bit of a hack but it worked.

Strange.

Regards,
Ian.


Dan Buettner wrote:
> Ian, those backticks are standard stuff for mysqldump.
>
> A couple of thoughts -
> 1, are you sure your 'create database' succeeds?
> 2, long shot, but are you FTPing in ASCII mode? This *might* mess up
> the backtick character.
> 3, instead of cat file.sql | mysql, try this
> mysql -u root -p < file.sql
>
> HTH,
> Dan
>
>
> On 10/11/06, Ian Collins <ian.collins@kiwiplan.co.nz> wrote:
>> Hi,
>> I have 2 identical Linux machines setup with identical my.cnf files
>> (except for server-id) and both running 5.0.26.
>>
>> On server A, I run,
>>
>> mysqldump -h localhost -u root -p... --single-transaction --flush-logs
>> --delete-master-logs --master-data=1 --databases db1 db2 > dumpfile
>>
>> I copy dumpfile to server B
>> and extract with,
>>
>> mysqladmin -u root -p... create db1
>> mysqladmin -u root -p... create db2
>>
>> cat dumpfile | mysql -u root -p...
>>
>> I get the error,
>>
>> ERROR 1049 at line 25: Unknown database '`db1`'
>>
>> Note the backticks around the database name.
>> Looking at dumpfile, I see,
>>
>> use `db1`
>>
>> I tried doing the mysqldump with --compatible=ansi which changes the
>> backticks to double quotes, but get the same error,
>>
>> ERROR 1049 at line 25: Unknown database '"db1"'.
>>
>> I can't edit dumpfile as it is 8Gb (ok, I can split it and stuff like
>> that ... but come on!!)
>>
>> What am I missing here? Has anyone else seen this?
>>
>> Regards,
>> Ian Collins.

>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:30 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com