mysqldump and database name is like "^-"
am 15.10.2005 11:55:24 von Vangelis Katsikaros
Hello
I noticed the following about mysqldump. I think it can't backup
databases starting with "-" dash.
I create a database named : -dash
and one named: _underscore
When backing up the _underscore
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p
_underscore > _backup.sql
it works fine
But with the -dash database I get:
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p -dash >
-backup.sql
mysqldump: unknown option '-s'
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p
--database -dash > -backup.sql
mysqldump: unknown option '-s'
I tried to "escpe" the dash but...
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p
--database \-dash > -backup.sql
Enter password: ******
mysqldump: Got error: 1102: Incorrect database name '\-dash' when
selecting thedatabase
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p
--database `\-dash` > -backup.sql
Enter password: ******
mysqldump: Got error: 1102: Incorrect database name '`\-dash`' when
selecting the database
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p
--database '\-dash' > -backup.sql
Enter password: ******
mysqldump: Got error: 1102: Incorrect database name ''\-dash'' when
selecting the database
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p
--database "\-dash" > -backup.sql
Enter password: ******
mysqldump: Got error: 1102: Incorrect database name '\-dash' when
selecting the database
....without escaping the dash
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p
--database `-dash` > -backup.sql
Enter password: ******
mysqldump: Got error: 1049: Unknown database '`-dash`' when selecting
the database
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p
--database '-dash' > -backup.sql
Enter password: ******
mysqldump: Got error: 1049: Unknown database ''-dash'' when selecting
the database
C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p
--database "-dash" > -backup.sql
mysqldump: unknown option '-s'
I might have overseen something. And before you ask, I don't have a
database starting with dash :) I was just playing around...
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org
Re: mysqldump and database name is like "^-"
am 15.10.2005 13:09:54 von Charles Mabbott
I think you will find changing the name to _dash will work out but the '-'
will give some computer systems a tummy ache. While the '_' does seem to
work on most platforms.
Chuck
----- Original Message -----
From: "Vangelis Katsikaros"
To:
Sent: Saturday, October 15, 2005 5:55 AM
Subject: mysqldump and database name is like '^-'
> Hello
> I noticed the following about mysqldump. I think it can't backup databases
> starting with "-" dash.
> I create a database named : -dash
> and one named: _underscore
>
> When backing up the _underscore
>
> C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p
> _underscore > _backup.sql
>
> it works fine
>
> But with the -dash database I get:
>
> C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p -dash
> > -backup.sql
> mysqldump: unknown option '-s'
>
> C:\Program Files\MySQL\MySQL Server
> 4.1\bin>mysqldump -uroot -p --database -dash > -backup.sql
> mysqldump: unknown option '-s'
>
> I tried to "escpe" the dash but...
>
> C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p --database
> \-dash > -backup.sql
> Enter password: ******
> mysqldump: Got error: 1102: Incorrect database name '\-dash' when
> selecting thedatabase
>
> C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p --database
> `\-dash` > -backup.sql
> Enter password: ******
> mysqldump: Got error: 1102: Incorrect database name '`\-dash`' when
> selecting the database
>
> C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p --database
> '\-dash' > -backup.sql
> Enter password: ******
> mysqldump: Got error: 1102: Incorrect database name ''\-dash'' when
> selecting the database
>
> C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p --database
> "\-dash" > -backup.sql
> Enter password: ******
> mysqldump: Got error: 1102: Incorrect database name '\-dash' when
> selecting the database
>
>
>
> ...without escaping the dash
>
> C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p --database
> `-dash` > -backup.sql
> Enter password: ******
> mysqldump: Got error: 1049: Unknown database '`-dash`' when selecting the
> database
>
> C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p --database
> '-dash' > -backup.sql
> Enter password: ******
> mysqldump: Got error: 1049: Unknown database ''-dash'' when selecting the
> database
>
> C:\Program Files\MySQL\MySQL Server 4.1\bin>mysqldump -uroot -p --database
> "-dash" > -backup.sql
> mysqldump: unknown option '-s'
>
> I might have overseen something. And before you ask, I don't have a
> database starting with dash :) I was just playing around...
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> --
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe:
> http://lists.mysql.com/win32?unsub=crmabbott@comcast.net
>
--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org