Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Double Quote marks in SQL backup file (want single)

Status
Not open for further replies.

benzagod

Programmer
Feb 10, 2005
4
GB
when I do a backup of a table on my mySQL Administrator I get CREATE TABLE "product" (double quotes), I want product` (single quote marks) where do I specify this I tried all I can imagine already to do with character set..and backup options
(this messes up on restore with double quotes on DB I need to add this to.. please don't sugest the obvious: modify it to make it work on restore by replacing " with ` )
 
I can't see why table names would be enclosed in double-quotes; it's not valid MySQL syntax. The only acceptable character is the backtick (`), and there is no option to change that. My version of MySQL Administrator correctly uses back-ticks.

I accept you're not imagining things, but could you show us an actual backup of a very small table?
 
Apologies, it is possible for MySQL to accept and produce double-quotes around table names. This is controlled with the server variable "sql_mode".

If you have a look in your my.cnf file, in the [mysqld] section, you will probably find an entry saying "sql-mode=ANSI_QUOTES"; delete or comment-out this line. If the sql-mode line contains other values as well as ANSI_QUOTES, just remove the ANSI_QUOTES value. If my.cnf does not contain ANSI_QUOTES, then it is probably specified on the server startup command-line; if so, remove it from the command-line. Then restart the server.
 
Looked in MY.ini (mySQL 4.1.7 on windows 2kpro), but there was no mention of ANSI or Quotes in there.

ANSI was unchecked in Administrator

SNIP from backup file...
DROP TABLE IF EXISTS `class_use`;
CREATE TABLE "class_use" (
"CUTID" int(11) NOT NULL auto_increment,
"VCID" int(11) default '0',
"UCID" int(11) default '0',
"Note" varchar(255) default NULL,
"Uses" text,
"Exclusions" text,
PRIMARY KEY ("CUTID")
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

With ANSI checked in Administrator, all field names become double Quotes "TableName" "FieldName" etc.
 
okay the solution to this problem is to update mySQL Administrator to version 4.1, (I had 4.0)

In the backup options there is a check box for "compatibility mode".
Hope this helps someone with same problem :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top