Re: mysqldump output

2009-07-23 Thread peng yao
#mysqldump -u username -p -h mysqld_host databasename  database_name.sql
username is the mysqld server login name
mysqld_host is the mysqld server address or hostname
databasename is the database which you should dump

You can use man mysqldump or mysqldump --help to get more infomation

2009/7/21 zhu dingze mysql.li...@gmail.com

 we need more information,
 such as your client and server version, the command that exactly your input
 etc.

 2009/7/14 JingTian jingtian.seu...@gmail.com

  hi all,
 
  i use mysqldump to backup my database,
  the command line is; mysqldump -p -u -h database_name  database_name.sql
 
  i find in the database_name.sql, there is a line:
  Not dumping tablespaces as no INFORMATION_SCHEMA.FILES table on this
 server
 
  can anyone tell me what does it mean?
 
  thanks very much,
  --
  Tianjing
 



 --
 Dingze Zhu

 We are running the best Chinese MySQL and Solaris Community in China.
 Welcome to visit http://www.mysqlsystems.com



Re: mysqldump output

2009-07-20 Thread zhu dingze
we need more information,
such as your client and server version, the command that exactly your input
etc.

2009/7/14 JingTian jingtian.seu...@gmail.com

 hi all,

 i use mysqldump to backup my database,
 the command line is; mysqldump -p -u -h database_name  database_name.sql

 i find in the database_name.sql, there is a line:
 Not dumping tablespaces as no INFORMATION_SCHEMA.FILES table on this server

 can anyone tell me what does it mean?

 thanks very much,
 --
 Tianjing




-- 
Dingze Zhu

We are running the best Chinese MySQL and Solaris Community in China.
Welcome to visit http://www.mysqlsystems.com


mysqldump output

2009-07-14 Thread JingTian
hi all,

i use mysqldump to backup my database,
the command line is; mysqldump -p -u -h database_name  database_name.sql

i find in the database_name.sql, there is a line:
Not dumping tablespaces as no INFORMATION_SCHEMA.FILES table on this server

can anyone tell me what does it mean?

thanks very much,
-- 
Tianjing


Error importing from mysqldump output

2005-06-28 Thread Daniel Kasak
Hi all.

I'm testing out mysql-5.0.7. I dumped a database from 5.0.4 with the
command:
mysqldump --opt DB_NAME  DB_NAME.sql -p

Now I'm importing with:
mysql DB_NAME  DB_NAME.sql -p

The data has a field which has some quotes in it. The field looks like
this ( all quotes included ):
'' ''

ie 2x single quotes, a space, and 2x single quotes.
Don't ask me why. I didn't put it there. Anyway, mysqldump has packaged
this field as follows:
'\'\' \'\''

I'll put it into context inside an SQL statement:
insert into some_table ( some_field ) values ( '\'\' \'\'' );

When I mysql hits this line, I get:
ERROR at line 895: Unknown command '\''.

The line looks properly escaped to me. Should I file a bug report?

-- 
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Error importing from mysqldump output

2005-06-28 Thread Daniel Kasak
Daniel Kasak wrote:

The data has a field which has some quotes in it. The field looks like
this ( all quotes included ):
'' ''

ie 2x single quotes, a space, and 2x single quotes.
Don't ask me why. I didn't put it there. Anyway, mysqldump has packaged
this field as follows:
'\'\' \'\''
  


Update. Perhaps this is 2 bugs in 1. I've found a LOT of this sort of
thing in the dump file. It seems that every single quote that's
encountered is represented:

\'\'...instead of just:
\'

But still, mysql should simply import 2 quotes where there should have
been one, right?

I don't know. I'm starting to get confused.

-- 
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Error importing from mysqldump output

2005-06-28 Thread Michael Stassen

Daniel Kasak wrote:


Hi all.

I'm testing out mysql-5.0.7. I dumped a database from 5.0.4 with the
command:
mysqldump --opt DB_NAME  DB_NAME.sql -p

Now I'm importing with:
mysql DB_NAME  DB_NAME.sql -p

The data has a field which has some quotes in it. The field looks like
this ( all quotes included ):
'' ''

ie 2x single quotes, a space, and 2x single quotes.
Don't ask me why. I didn't put it there. Anyway, mysqldump has packaged
this field as follows:
'\'\' \'\''

I'll put it into context inside an SQL statement:
insert into some_table ( some_field ) values ( '\'\' \'\'' );

When I mysql hits this line, I get:
ERROR at line 895: Unknown command '\''.

The line looks properly escaped to me. Should I file a bug report?


Mysql reports the first thing it didn't understand, which isn't necessarily 
the first thing wrong.  I note that it thought \' was a command, which implies 
it didn't see the preceding ' as the *start* of a string, which implies 
something went wrong earlier in the line.  Of course, it's impossible to guess 
what.  Could you post the entire line, and perhaps a line or two before?


Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Error importing from mysqldump output

2005-06-28 Thread Daniel Kasak
Michael Stassen wrote:

 Mysql reports the first thing it didn't understand, which isn't
 necessarily the first thing wrong.  I note that it thought \' was a
 command, which implies it didn't see the preceding ' as the *start* of
 a string, which implies something went wrong earlier in the line.  Of
 course, it's impossible to guess what.  Could you post the entire
 line, and perhaps a line or two before?

Unfortunately not, for a number of reasons.

Firstly, in the meantime I've been doing search  replace on the dump
file to get rid of the duplicated \'\' stuff.

Secondly, the dump file is HUGE, and I'm not really sure what part it
had a problem with. I probably *should* be able to narrow it down to the
table, by opening the dump file in a text editor and going to the line
number mentioned in the error, but I've tried that a couple of times and
whatever editor I use just locks up ... the file's far too big. I let
gedit run for 15 minutes before finally killing it.

Thirdly, if the error is where I think it is, the whole table has
confidential stuff in it, and I'd have to mask every mention of
companies / people. This wouldn't leave much.

Anyway, my original search and replace seems to have been a stupid thing
to do. Since I'm only testing things out ( trying to get stored
procedures working ), I didn't think to keep a backup of the backup in
case something happens. Frankly I'm not too concerned about it anyway.
I'll start from scratch, importing the data via ODBC, make a new
mysqldump file, and see if the problem persists. If it does, I'll be
back, and I won't destroy the evidence this time...

Dan

-- 
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: error importing from mysqldump output

2004-11-10 Thread SGreen
I agree that using a reserved word for any purpose than that for which it 
is reserved is a poor design choice. I also strongly encourage you to 
change the name of that field and any others that conflict with the 
reserved words list (the field name desc is another name that frequently 
causes this problem for just the same reason)

http://dev.mysql.com/doc/mysql/en/Reserved_words.html

 However, mysqldump does have the option to backtick-quote all field names 
in its CREATE TABLE statements. The full list of options is available if 
you run 

mysqldump --help

and the option you are interested in can be turned on either with  -Q or 
--quote-names. That makes your dump command read

daemon0% mysqldump -Q -S mysqld-daemon0.sock --master-data --all-databases 

  daemin0-dump.sql

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Daniel Kasak [EMAIL PROTECTED] wrote on 11/09/2004 06:16:38 
PM:

 Russell E Glaue wrote:
 
 snipped
 
  ERROR 1064 at line 14071: You have an error in your SQL syntax.  Check 

  the manual that corresponds to your MySQL server version for the right 

  syntax to use near 'order int(1) NOT NULL default '0',
PRIMARY KEY  (moduleID),
 
 snipped
 
  Would this possibly be a bug with mysqldump ?
  -RG
 
 'order' is a reserved word.
 I would rename that field, pronto!
 In my opinion the bug is not in mysqldump, but in mysql allowing you to 
 use a fieldname that is a reserved word.
 And yes I know about the backticks that mysqlcc uses, but surely this 
 causes more problems than it solves. See above example.
 
 -- 
 Daniel Kasak
 IT Developer
 NUS Consulting Group
 Level 5, 77 Pacific Highway
 North Sydney, NSW, Australia 2060
 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
 email: [EMAIL PROTECTED]
 website: http://www.nusconsulting.com.au
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

error importing from mysqldump output

2004-11-09 Thread Russell E Glaue
I did a mysqldump from serverA, took that output and did the following 
as illustrated below to import into serverB.
why did I get an error?

Did mysqldump output the wrong SQL syntax?  I would not think so, but I 
got this error which says so.

I am using mysql-4.0.20 on both servers.
I am importing with skip-grant-tables option, and no databases 
(including no mysql database).

daemon0% mysqldump -S mysqld-daemon0.sock --master-data --all-databases 
 daemin0-dump.sql

daemon1% mysql -S /tmp/mysqld-daemon1.sock  /tmp/daemon0-dump.sql
ERROR 1064 at line 14071: You have an error in your SQL syntax.  Check 
the manual that corresponds to your MySQL server version for the right 
syntax to use near 'order int(1) NOT NULL default '0',
  PRIMARY KEY  (moduleID),

CREATE TABLE modules (
  moduleID varchar(10) NOT NULL default '',
  moduleName varchar(50) NOT NULL default '',
  order int(1) NOT NULL default '0',
  PRIMARY KEY  (moduleID),
  UNIQUE KEY moduleID (moduleID)
) TYPE=MyISAM COMMENT='List of all Modules';

Would this possibly be a bug with mysqldump ?
-RG
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: error importing from mysqldump output

2004-11-09 Thread Daniel Kasak
Russell E Glaue wrote:
snipped
ERROR 1064 at line 14071: You have an error in your SQL syntax.  Check 
the manual that corresponds to your MySQL server version for the right 
syntax to use near 'order int(1) NOT NULL default '0',
  PRIMARY KEY  (moduleID),

snipped
Would this possibly be a bug with mysqldump ?
-RG
'order' is a reserved word.
I would rename that field, pronto!
In my opinion the bug is not in mysqldump, but in mysql allowing you to 
use a fieldname that is a reserved word.
And yes I know about the backticks that mysqlcc uses, but surely this 
causes more problems than it solves. See above example.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au
-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: error importing from mysqldump output

2004-11-09 Thread Russell E Glaue
Daniel Kasak wrote:
Russell E Glaue wrote:
snipped
ERROR 1064 at line 14071: You have an error in your SQL syntax.  Check 
the manual that corresponds to your MySQL server version for the right 
syntax to use near 'order int(1) NOT NULL default '0',
  PRIMARY KEY  (moduleID),

snipped
Would this possibly be a bug with mysqldump ?
-RG

'order' is a reserved word.
I would rename that field, pronto!
In my opinion the bug is not in mysqldump, but in mysql allowing you to 
use a fieldname that is a reserved word.
And yes I know about the backticks that mysqlcc uses, but surely this 
causes more problems than it solves. See above example.

So if a word is reserved, a table with that same spelling cannot exist?
If this is so, then why did mysql allow it to be created?
-RG
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: error importing from mysqldump output

2004-11-09 Thread Daniel Kasak
Russell E Glaue wrote:
'order' is a reserved word.
I would rename that field, pronto!
In my opinion the bug is not in mysqldump, but in mysql allowing you 
to use a fieldname that is a reserved word.
And yes I know about the backticks that mysqlcc uses, but surely this 
causes more problems than it solves. See above example.

So if a word is reserved, a table with that same spelling cannot exist?
That's right. You can't ( you *shouldn't* be able to ) use reserved for 
table or field names.

If this is so, then why did mysql allow it to be created?
I really don't know. See my above comments.
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au
-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: error importing from mysqldump output

2004-11-09 Thread Paul DuBois
At 10:33 +1100 11/10/04, Daniel Kasak wrote:
Russell E Glaue wrote:
'order' is a reserved word.
I would rename that field, pronto!
In my opinion the bug is not in mysqldump, but in mysql allowing 
you to use a fieldname that is a reserved word.
And yes I know about the backticks that mysqlcc uses, but surely 
this causes more problems than it solves. See above example.

So if a word is reserved, a table with that same spelling cannot exist?
That's right. You can't ( you *shouldn't* be able to ) use reserved 
for table or field names.

If this is so, then why did mysql allow it to be created?
I really don't know. See my above comments.
order is indeed a reserved word, but it is easily possible to create
a table that has order (or any other reserved word) as a column name
if you quote it with identifier quoting characters (backticks):
http://dev.mysql.com/doc/mysql/en/Legal_names.html
As for mysqldump, if you use the command mysqldump --help,
you get a list of alowable options.  One of them is this:
  -Q, --quote-names   Quote table and column names with a `
So if you add -Q or --quote-names to your mysqldump command, you should
get dump output that can be imported without the problems that you are
seeing.
This option is on by default in MySQL 4.1, by the way, which helps
forestall the issue.  It remains off in 4.0 by default so as not to
break existing 4.0 scripts that use mysqldump.
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


how to change mysqldump output txt file format?

2004-09-24 Thread Monet
Hello everyone,

In mysqldump output txt file, all datetime, varchar,
text fields value are surrounding by single quotes. Is
there any way that the single quotes can be replaced
by double quotes in the txt file?
Furthermore, if you have a single quote in text field,
it will automatically replaced by \’. But I like to
keep it in the way it input.

For instances, 
--
-- Dumping data for table 'week'
--

INSERT INTO week VALUES ('2004-03-23
10:13:00','3015','201','2003-06-13', 'coach
children\'s league ')

I want the output looks like:
INSERT INTO week VALUES (“2004-03-23
10:13:00“,“3015“,“201“,“2003-06-13“, “coach children's
league”)

So, is there any way to define mysqldump output file
format?

Thanks,
Monet



__
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: how to change mysqldump output txt file format?

2004-09-24 Thread Jim Grill
 Hello everyone,

 In mysqldump output txt file, all datetime, varchar,
 text fields value are surrounding by single quotes. Is
 there any way that the single quotes can be replaced
 by double quotes in the txt file?
 Furthermore, if you have a single quote in text field,
 it will automatically replaced by \'. But I like to
 keep it in the way it input.


There is no way to change the use of single quotes in a standard dump. The
only time you have a choice is when you use the -T option, which creates a
tab or csv type dump files depending on options present on the command line.
You could use this option if you wanted. The only draw back is that
mysqdump -T must be run on the same machine as the server.

However, why is the presents of escaped single quotes a problem? They are
only escaped to let MySQL know to treat them as literal single quotes and
not string delimiters. They do not actually get inserted into your table
with the slashes.

Regards,

Jim Grill



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: how to change mysqldump output txt file format?

2004-09-24 Thread SGreen
Jim - He needs to change the format because he isn't exporting from one 
MySQL database to another His destination database doesn't like the 
escaped single quotes.

Here is the manual page for mysqldump: 
http://dev.mysql.com/doc/mysql/en/mysqldump.html

Is there nothing you can do with 
--fields-terminated-by=... 
--fields-enclosed-by=... 
--fields-optionally-enclosed-by=... 
--fields-escaped-by=... 
--lines-terminated-by=...

to get what you want from mysqldump?

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Jim Grill [EMAIL PROTECTED] wrote on 09/24/2004 02:35:40 PM:

  Hello everyone,
 
  In mysqldump output txt file, all datetime, varchar,
  text fields value are surrounding by single quotes. Is
  there any way that the single quotes can be replaced
  by double quotes in the txt file?
  Furthermore, if you have a single quote in text field,
  it will automatically replaced by \'. But I like to
  keep it in the way it input.
 
 
 There is no way to change the use of single quotes in a standard dump. 
The
 only time you have a choice is when you use the -T option, which creates 
a
 tab or csv type dump files depending on options present on the command 
line.
 You could use this option if you wanted. The only draw back is that
 mysqdump -T must be run on the same machine as the server.
 
 However, why is the presents of escaped single quotes a problem? They 
are
 only escaped to let MySQL know to treat them as literal single quotes 
and
 not string delimiters. They do not actually get inserted into your table
 with the slashes.
 
 Regards,
 
 Jim Grill
 
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 


Re: how to change mysqldump output txt file format?

2004-09-24 Thread Jim Grill
 Is there nothing you can do with 
 --fields-terminated-by=... 
 --fields-enclosed-by=... 
 --fields-optionally-enclosed-by=... 
 --fields-escaped-by=... 
 --lines-terminated-by=...

As I mentioned, those options **only** apply when using the -T option which creates 
a tab delimited dump file. That would be a cool option though. :-)

There are a number programs that can assist with converting to and from MySQL if 
that's the goal.

Regards,

Jim Grill

  - Original Message - 
  From: [EMAIL PROTECTED] 
  To: Jim Grill 
  Cc: Monet ; mysql 
  Sent: Friday, September 24, 2004 1:59 PM
  Subject: Re: how to change mysqldump output txt file format?



  Jim - He needs to change the format because he isn't exporting from one MySQL 
database to another His destination database doesn't like the escaped single 
quotes. 

  Here is the manual page for mysqldump:  
http://dev.mysql.com/doc/mysql/en/mysqldump.html 

  Is there nothing you can do with 
  --fields-terminated-by=... 
  --fields-enclosed-by=... 
  --fields-optionally-enclosed-by=... 
  --fields-escaped-by=... 
  --lines-terminated-by=... 

  to get what you want from mysqldump? 

  Shawn Green
  Database Administrator
  Unimin Corporation - Spruce Pine 

  Jim Grill [EMAIL PROTECTED] wrote on 09/24/2004 02:35:40 PM:

Hello everyone,
   
In mysqldump output txt file, all datetime, varchar,
text fields value are surrounding by single quotes. Is
there any way that the single quotes can be replaced
by double quotes in the txt file?
Furthermore, if you have a single quote in text field,
it will automatically replaced by \'. But I like to
keep it in the way it input.
   
   
   There is no way to change the use of single quotes in a standard dump. The
   only time you have a choice is when you use the -T option, which creates a
   tab or csv type dump files depending on options present on the command line.
   You could use this option if you wanted. The only draw back is that
   mysqdump -T must be run on the same machine as the server.
   
   However, why is the presents of escaped single quotes a problem? They are
   only escaped to let MySQL know to treat them as literal single quotes and
   not string delimiters. They do not actually get inserted into your table
   with the slashes.
   
   Regards,
   
   Jim Grill
   
   
   
   -- 
   MySQL General Mailing List
   For list archives: http://lists.mysql.com/mysql
   To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
   


Re: how to change mysqldump output txt file format?

2004-09-24 Thread Monet
Yeah. I am moving data from mysql server to sql
server. 
Because I have single quote in some strings, it
generated errors when I ran mysqldump scripts in sql
server to import data in. 
i.e. strings Here's, Martin's ,... caused trouble.
Does that mean sql didn't recognize escaped single
quote?
Thanks,
Monet


--- [EMAIL PROTECTED] wrote:

 Jim - He needs to change the format because he isn't
 exporting from one 
 MySQL database to another His destination
 database doesn't like the 
 escaped single quotes.
 
 Here is the manual page for mysqldump: 
 http://dev.mysql.com/doc/mysql/en/mysqldump.html
 
 Is there nothing you can do with 
 --fields-terminated-by=... 
 --fields-enclosed-by=... 
 --fields-optionally-enclosed-by=... 
 --fields-escaped-by=... 
 --lines-terminated-by=...
 
 to get what you want from mysqldump?
 
 Shawn Green
 Database Administrator
 Unimin Corporation - Spruce Pine
 
 Jim Grill [EMAIL PROTECTED] wrote on
 09/24/2004 02:35:40 PM:
 
   Hello everyone,
  
   In mysqldump output txt file, all datetime,
 varchar,
   text fields value are surrounding by single
 quotes. Is
   there any way that the single quotes can be
 replaced
   by double quotes in the txt file?
   Furthermore, if you have a single quote in text
 field,
   it will automatically replaced by \'. But I like
 to
   keep it in the way it input.
  
  
  There is no way to change the use of single quotes
 in a standard dump. 
 The
  only time you have a choice is when you use the -T
 option, which creates 
 a
  tab or csv type dump files depending on options
 present on the command 
 line.
  You could use this option if you wanted. The only
 draw back is that
  mysqdump -T must be run on the same machine as the
 server.
  
  However, why is the presents of escaped single
 quotes a problem? They 
 are
  only escaped to let MySQL know to treat them as
 literal single quotes 
 and
  not string delimiters. They do not actually get
 inserted into your table
  with the slashes.
  
  Regards,
  
  Jim Grill
  
  
  
  -- 
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]
  
 




___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: how to change mysqldump output txt file format?

2004-09-24 Thread Jim Grill
 Yeah. I am moving data from mysql server to sql
 server.
 Because I have single quote in some strings, it
 generated errors when I ran mysqldump scripts in sql
 server to import data in.
 i.e. strings Here's, Martin's ,... caused trouble.
 Does that mean sql didn't recognize escaped single
 quote?
 Thanks,
 Monet

I *think* sql server escapes single quotes *only* when two appear together.
So two single quotes in a row equals one single quote. Brilliant, eh? ...To
be a fly on the wall when that decision was made. :-) I think that is
actually the ANSI SQL standard for escaping single quotes and not just an M$
thing. It works in MySQL too by the way. Try it:

INSERT INTO testing values('Here''s','Martin''s','mom''s');

same as

INSERT INTO testing values('Here\'s','Martin\'s','mom\'s');

I suppose you could try to open the dump file in an editor like vi or
notepad or some other editor that has a search and replace and replace \'
with '' and see what happens. vi: :%s/\\'/''/g

The alternative would be to use mysqdump with -T option and use the
options --fields-terminated-by=, --fields-enclosed-by=, --fields-optionally-
enclosed-by=, --fields-escaped-by=, and --lines-terminated-by= to make a csv
file. You can use BCP or MS DTS to load a csv into sql server tables. There
may be another sql server equivelant to LOAD DATA INFILE that can accept csv
or tsv. Who knows???

Good luck,

Jim Grill




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: how to change mysqldump output txt file format?

2004-09-24 Thread Monet
Thanks Jim. Great suggestions.
I will try both to see which one is better for my
case.
Appreciated your help.
Monet

--- Jim Grill [EMAIL PROTECTED] wrote:

  Yeah. I am moving data from mysql server to sql
  server.
  Because I have single quote in some strings, it
  generated errors when I ran mysqldump scripts in
 sql
  server to import data in.
  i.e. strings Here's, Martin's ,... caused trouble.
  Does that mean sql didn't recognize escaped single
  quote?
  Thanks,
  Monet
 
 I *think* sql server escapes single quotes *only*
 when two appear together.
 So two single quotes in a row equals one single
 quote. Brilliant, eh? ...To
 be a fly on the wall when that decision was made.
 :-) I think that is
 actually the ANSI SQL standard for escaping single
 quotes and not just an M$
 thing. It works in MySQL too by the way. Try it:
 
 INSERT INTO testing
 values('Here''s','Martin''s','mom''s');
 
 same as
 
 INSERT INTO testing
 values('Here\'s','Martin\'s','mom\'s');
 
 I suppose you could try to open the dump file in an
 editor like vi or
 notepad or some other editor that has a search and
 replace and replace \'
 with '' and see what happens. vi: :%s/\\'/''/g
 
 The alternative would be to use mysqdump with -T
 option and use the
 options --fields-terminated-by=,
 --fields-enclosed-by=, --fields-optionally-
 enclosed-by=, --fields-escaped-by=, and
 --lines-terminated-by= to make a csv
 file. You can use BCP or MS DTS to load a csv into
 sql server tables. There
 may be another sql server equivelant to LOAD DATA
 INFILE that can accept csv
 or tsv. Who knows???
 
 Good luck,
 
 Jim Grill
 
 
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   

http://lists.mysql.com/[EMAIL PROTECTED]
 
 




__
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Restoring db from mysqldump output problem...

2002-12-20 Thread Jeff Snoxell
Hello,

I've successfully backed up my database to JeffsDB.sql using mysqldump with 
the -opt option.

When I try to restore it using: mysql -h myhost -u myusername -ppassword 
JeffsDB  JeffsDB.sql

I get:

ERROR 1065 at line 21: Query was empty

Now, line 21 of the SQL file contains:

/*!4 ALTER TABLE Dealers DISABLE KEYS */;

If I remove all the lines like the one above then something seems to happen 
but the process terminates moaning about some problem in my SQL 
statement... it points to a huge (1Mb ish) single line of values which were 
created by mysqldump and which, hence, _should_ be ok shouldn't they.

My questions:

1. Why should I have to remove those comments from the SQL shouldn't it 
just work?

2. Any ideas as to why, even with the comments removed, my SQL is reported 
as erroneous? Is it something to do with the very long single line and the 
fact that my mysql server is remote?

Many thanks, again!,


Jeff


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: gunk in mysqldump output

2002-04-16 Thread Bill Marrs

I don't have --no-disable-keys in my version of myqldump (Ver 8.21 Distrib 
3.23.48).  (-K doesn't seem to do anything, I assume it's the default).

I actually wouldn't mind disabling keys for the load, but I don't 
understand how the /*!4 ... stuff is suppose to get used.

Is this a half-implemented feature?

-bill

At 04:56 PM 4/15/2002, Nick Pasich wrote:
Use option -K or --no-disable-keys with myqldump.
  In some recent release of MySQL, lines like this:
 
  /*!4 ALTER TABLE States DISABLE KEYS */;
 
  ...were added to the output of mysqldump --opt.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




gunk in mysqldump output

2002-04-15 Thread Bill Marrs

In some recent release of MySQL, lines like this:

/*!4 ALTER TABLE States DISABLE KEYS */;

...were added to the output of mysqldump --opt.

This causes my usually load statement:

mysql  dumpfile

...to fail with ERROR 1046 at line 11: No Database Selected.

If I do mydsql -f  dumpfile it works (with errors), but I figure I'm 
missing something.

Why were these /*... lines added to dump output if they don't parse?

Should I be using some alternate method for loading now?

-bill




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: gunk in mysqldump output

2002-04-15 Thread Nick Pasich


 Use option -K or --no-disable-keys with myqldump.


 Date: Mon, 15 Apr 2002 09:37:43 -0400
 To: [EMAIL PROTECTED]
 From: Bill Marrs [EMAIL PROTECTED]
 Subject: gunk in mysqldump output
 
 In some recent release of MySQL, lines like this:
 
 /*!4 ALTER TABLE States DISABLE KEYS */;
 
 ...were added to the output of mysqldump --opt.
 
 This causes my usually load statement:
 
 mysql  dumpfile
 
 ...to fail with ERROR 1046 at line 11: No Database Selected.
 
 If I do mydsql -f  dumpfile it works (with errors), but I figure I'm 
 missing something.
 
 Why were these /*... lines added to dump output if they don't parse?
 
 Should I be using some alternate method for loading now?
 
 -bill

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




mysqldump output file not valid as input file for mysql client

2001-02-22 Thread loschert

Description:

As of mysql 3.23.33, a dumpfile generated with mysqldump (using the flags:
--opt --all-databases) creates a file which will not be uploaded correctly
using the mysql client (as in: 'mysql -u root -pXX -q -s  dumpfile.sql').

Specifically, the problem relates to mysqldump's outputting of table keys.
See the actual dump of mysql.db below:

DROP TABLE IF EXISTS db;
CREATE TABLE db (
  Host char(60) binary NOT NULL default '',
  Db char(64) binary NOT NULL default '',
  User char(16) binary NOT NULL default '',
  Select_priv enum('N','Y') NOT NULL default 'N',
  Insert_priv enum('N','Y') NOT NULL default 'N',
  Update_priv enum('N','Y') NOT NULL default 'N',
  Delete_priv enum('N','Y') NOT NULL default 'N',
  Create_priv enum('N','Y') NOT NULL default 'N',
  Drop_priv enum('N','Y') NOT NULL default 'N',
  Grant_priv enum('N','Y') NOT NULL default 'N',
  References_priv enum('N','Y') NOT NULL default 'N',
  Index_priv enum('N','Y') NOT NULL default 'N',
  Alter_priv enum('N','Y') NOT NULL default 'N',
  PRIMARY KEY (Host,Db,User),
  KEY User(User)    pukes on this line
) TYPE=MyISAM COMMENT='Database privileges';

If a space is added (as in: "KEY User (User)"), the file will import correctly.

I looked through the source file mysqldump.c and it appears that there always
should be a space between the key name and the key columns, but my personal
dumpfiles show that all non-primary keys have no space between the key name
and the key column names.  Go figure. :)  Needless to say I don't get it.

How-To-Repeat:
See above description.
Fix:
See above description.

Submitter-Id:  submitter ID
Originator:Matt Loschert
Organization:

  Matt Loschert | email: [EMAIL PROTECTED]|
  Software Engineer | web:   http://www.servint.net/ |
  ServInt Internet Services | phone: (703) 847-1381  |
  

MySQL support: none
Synopsis:  mysqldump output file not valid as input file for mysql client
Severity:  non-critical
Priority:  medium
Category:  mysql
Class: sw-bug
Release:   mysql-3.23.33 (Source distribution)

Environment:

System: FreeBSD delft.servint.com 4.2-STABLE FreeBSD 4.2-STABLE #0: Tue Feb  6 
11:43:35 EST 2001 
[EMAIL PROTECTED]:/disk2/cvsup/branches/releng_4/obj/disk2/cvsup/branches/releng_4/src/sys/QUICKIE
  i386


Some paths:  /usr/bin/perl /usr/bin/make /usr/local/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Using builtin specs.
gcc version 2.95.2 19991024 (release)
Compilation info: CC='gcc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
LIBC: 
-r--r--r--  1 root  wheel  1169450 Feb  6 12:05 /usr/lib/libc.a
lrwxr-xr-x  1 root  wheel  9 Feb  6 12:05 /usr/lib/libc.so - libc.so.4
-r--r--r--  1 root  wheel  559516 Feb  6 12:05 /usr/lib/libc.so.4
Configure command: ./configure  --prefix=/usr/local/mysql-23.33 --with-low-memory
Perl: This is perl, version 5.005_03 built for i386-freebsd

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: mysqldump output file not valid as input file for mysql client

2001-02-22 Thread Sinisa Milivojevic

[EMAIL PROTECTED] writes:
  Description:
  
   As of mysql 3.23.33, a dumpfile generated with mysqldump (using the flags:
  --opt --all-databases) creates a file which will not be uploaded correctly
  using the mysql client (as in: 'mysql -u root -pXX -q -s  
 dumpfile.sql').
  
   Specifically, the problem relates to mysqldump's outputting of table keys.
  See the actual dump of mysql.db below:
  
  DROP TABLE IF EXISTS db;
  CREATE TABLE db (
Host char(60) binary NOT NULL default '',
Db char(64) binary NOT NULL default '',
User char(16) binary NOT NULL default '',
Select_priv enum('N','Y') NOT NULL default 'N',
Insert_priv enum('N','Y') NOT NULL default 'N',
Update_priv enum('N','Y') NOT NULL default 'N',
Delete_priv enum('N','Y') NOT NULL default 'N',
Create_priv enum('N','Y') NOT NULL default 'N',
Drop_priv enum('N','Y') NOT NULL default 'N',
Grant_priv enum('N','Y') NOT NULL default 'N',
References_priv enum('N','Y') NOT NULL default 'N',
Index_priv enum('N','Y') NOT NULL default 'N',
Alter_priv enum('N','Y') NOT NULL default 'N',
PRIMARY KEY (Host,Db,User),
KEY User(User)    pukes on this line
  ) TYPE=MyISAM COMMENT='Database privileges';
  
   If a space is added (as in: "KEY User (User)"), the file will import correctly.
  
   I looked through the source file mysqldump.c and it appears that there always
   should be a space between the key name and the key columns, but my personal
   dumpfiles show that all non-primary keys have no space between the key name
   and the key column names.  Go figure. :)  Needless to say I don't get it.
  
  How-To-Repeat:
   See above description.
  Fix:
   See above description.
  
  Submitter-Id:   submitter ID
  Originator: Matt Loschert
  Organization:
  
Matt Loschert  | email: [EMAIL PROTECTED]|
Software Engineer  | web:   http://www.servint.net/ |
ServInt Internet Services  | phone: (703) 847-1381  |

  
  MySQL support: none
  Synopsis:   mysqldump output file not valid as input file for mysql client
  Severity:   non-critical
  Priority:   medium
  Category:   mysql
  Class:  sw-bug
  Release:mysql-3.23.33 (Source distribution)
  
  Environment:
   
  System: FreeBSD delft.servint.com 4.2-STABLE FreeBSD 4.2-STABLE #0: Tue Feb  6 
 11:43:35 EST 2001 
 [EMAIL PROTECTED]:/disk2/cvsup/branches/releng_4/obj/disk2/cvsup/branches/releng_4/src/sys/QUICKIE
   i386
  
  
  Some paths:  /usr/bin/perl /usr/bin/make /usr/local/bin/gmake /usr/bin/gcc 
 /usr/bin/cc
  GCC: Using builtin specs.
  gcc version 2.95.2 19991024 (release)
  Compilation info: CC='gcc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
  LIBC: 
  -r--r--r--  1 root  wheel  1169450 Feb  6 12:05 /usr/lib/libc.a
  lrwxr-xr-x  1 root  wheel  9 Feb  6 12:05 /usr/lib/libc.so - libc.so.4
  -r--r--r--  1 root  wheel  559516 Feb  6 12:05 /usr/lib/libc.so.4
  Configure command: ./configure  --prefix=/usr/local/mysql-23.33 --with-low-memory
  Perl: This is perl, version 5.005_03 built for i386-freebsd
  


Hi!

The above happens as USER is a keyword in MySQL.


Regards,

Sinisa

    __ _   _  ___ ==  MySQL AB
 /*/\*\/\*\   /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
/*/ /*/ /*/   \*\_   |*|   |*||*| mailto:[EMAIL PROTECTED]
   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*| Larnaca, Cyprus
  /*/ /*/  /*/\*\_/*/ \*\_/*/ |*|
  /*/^^^\*\^^^
 /*/ \*\Developers Team

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: mysqldump output file not valid as input file for mysql client

2001-02-22 Thread Matt Loschert

On Thu, 22 Feb 2001, Sinisa Milivojevic wrote:

 [EMAIL PROTECTED] writes:
   Description:
  
  As of mysql 3.23.33, a dumpfile generated with mysqldump (using the flags:
   --opt --all-databases) creates a file which will not be uploaded correctly
   using the mysql client (as in: 'mysql -u root -pXX -q -s  
dumpfile.sql').
  
  Specifically, the problem relates to mysqldump's outputting of table keys.
   See the actual dump of mysql.db below:
  
   DROP TABLE IF EXISTS db;
   CREATE TABLE db (
 Host char(60) binary NOT NULL default '',
 Db char(64) binary NOT NULL default '',
 User char(16) binary NOT NULL default '',
 Select_priv enum('N','Y') NOT NULL default 'N',
 Insert_priv enum('N','Y') NOT NULL default 'N',
 Update_priv enum('N','Y') NOT NULL default 'N',
 Delete_priv enum('N','Y') NOT NULL default 'N',
 Create_priv enum('N','Y') NOT NULL default 'N',
 Drop_priv enum('N','Y') NOT NULL default 'N',
 Grant_priv enum('N','Y') NOT NULL default 'N',
 References_priv enum('N','Y') NOT NULL default 'N',
 Index_priv enum('N','Y') NOT NULL default 'N',
 Alter_priv enum('N','Y') NOT NULL default 'N',
 PRIMARY KEY (Host,Db,User),
 KEY User(User)    pukes on this line
   ) TYPE=MyISAM COMMENT='Database privileges';
  
  If a space is added (as in: "KEY User (User)"), the file will import correctly.
  
  I looked through the source file mysqldump.c and it appears that there always
  should be a space between the key name and the key columns, but my personal
  dumpfiles show that all non-primary keys have no space between the key name
  and the key column names.  Go figure. :)  Needless to say I don't get it.
  
   How-To-Repeat:
  See above description.
   Fix:
  See above description.
  
   Submitter-Id: submitter ID
   Originator:   Matt Loschert
   Organization:
  
 Matt Loschert| email: [EMAIL PROTECTED]|
 Software Engineer| web:   http://www.servint.net/ |
 ServInt Internet Services| phone: (703) 847-1381  |
  
   
   MySQL support: none
   Synopsis: mysqldump output file not valid as input file for mysql client
   Severity: non-critical
   Priority: medium
   Category: mysql
   Class:sw-bug
   Release:  mysql-3.23.33 (Source distribution)
  
   Environment:
  
   System: FreeBSD delft.servint.com 4.2-STABLE FreeBSD 4.2-STABLE #0: Tue Feb  6 
11:43:35 EST 2001 
[EMAIL PROTECTED]:/disk2/cvsup/branches/releng_4/obj/disk2/cvsup/branches/releng_4/src/sys/QUICKIE
  i386
  
  
   Some paths:  /usr/bin/perl /usr/bin/make /usr/local/bin/gmake /usr/bin/gcc 
/usr/bin/cc
   GCC: Using builtin specs.
   gcc version 2.95.2 19991024 (release)
   Compilation info: CC='gcc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
   LIBC:
   -r--r--r--  1 root  wheel  1169450 Feb  6 12:05 /usr/lib/libc.a
   lrwxr-xr-x  1 root  wheel  9 Feb  6 12:05 /usr/lib/libc.so - libc.so.4
   -r--r--r--  1 root  wheel  559516 Feb  6 12:05 /usr/lib/libc.so.4
   Configure command: ./configure  --prefix=/usr/local/mysql-23.33 --with-low-memory
   Perl: This is perl, version 5.005_03 built for i386-freebsd
  


 Hi!

 The above happens as USER is a keyword in MySQL.


 Regards,

 Sinisa

Sure, but this is a standard dump of the whole database, and the mysql
client is having problems reloading the **mysql** database.  The mysql.db
table defines this key, not one of my tables.  If you cannot use the
--all-databases flag to mysqldump to make a valid backup file, what is the
flag useful for?  :)

By the way, this used to work.  I am not sure exactly what release it
stopped working in.

Thanks for the help.

- Matt

--
Matt Loschert   | email: [EMAIL PROTECTED]|
Software Engineer   | web:   http://www.servint.net/ |
ServInt Internet Services   | phone: (703) 847-1381  |



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: mysqldump output file not valid as input file for mysql client

2001-02-22 Thread Sinisa Milivojevic

Matt Loschert writes:
  On Thu, 22 Feb 2001, Sinisa Milivojevic wrote:
  
   [EMAIL PROTECTED] writes:
 Description:

 As of mysql 3.23.33, a dumpfile generated with mysqldump (using the 
 flags:
 --opt --all-databases) creates a file which will not be uploaded 
 correctly
 using the mysql client (as in: 'mysql -u root -pXX -q -s  
 dumpfile.sql').

 Specifically, the problem relates to mysqldump's outputting of table 
 keys.
 See the actual dump of mysql.db below:

 DROP TABLE IF EXISTS db;
 CREATE TABLE db (
   Host char(60) binary NOT NULL default '',
   Db char(64) binary NOT NULL default '',
   User char(16) binary NOT NULL default '',
   Select_priv enum('N','Y') NOT NULL default 'N',
   Insert_priv enum('N','Y') NOT NULL default 'N',
   Update_priv enum('N','Y') NOT NULL default 'N',
   Delete_priv enum('N','Y') NOT NULL default 'N',
   Create_priv enum('N','Y') NOT NULL default 'N',
   Drop_priv enum('N','Y') NOT NULL default 'N',
   Grant_priv enum('N','Y') NOT NULL default 'N',
   References_priv enum('N','Y') NOT NULL default 'N',
   Index_priv enum('N','Y') NOT NULL default 'N',
   Alter_priv enum('N','Y') NOT NULL default 'N',
   PRIMARY KEY (Host,Db,User),
   KEY User(User)    pukes on this line
 ) TYPE=MyISAM COMMENT='Database privileges';

 If a space is added (as in: "KEY User (User)"), the file will import 
 correctly.

 I looked through the source file mysqldump.c and it appears that there 
 always
 should be a space between the key name and the key columns, but my 
 personal
 dumpfiles show that all non-primary keys have no space between the key 
 name
 and the key column names.  Go figure. :)  Needless to say I don't get 
 it.

 How-To-Repeat:
 See above description.
 Fix:
 See above description.

 Submitter-Id:  submitter ID
 Originator:Matt Loschert
 Organization:

   Matt Loschert | email: [EMAIL PROTECTED]|
   Software Engineer | web:   http://www.servint.net/ |
   ServInt Internet Services | phone: (703) 847-1381  |

 
 MySQL support: none
 Synopsis:  mysqldump output file not valid as input file for mysql client
 Severity:  non-critical
 Priority:  medium
 Category:  mysql
 Class: sw-bug
 Release:   mysql-3.23.33 (Source distribution)

 Environment:

 System: FreeBSD delft.servint.com 4.2-STABLE FreeBSD 4.2-STABLE #0: Tue Feb  6 
 11:43:35 EST 2001 
 [EMAIL PROTECTED]:/disk2/cvsup/branches/releng_4/obj/disk2/cvsup/branches/releng_4/src/sys/QUICKIE
   i386


 Some paths:  /usr/bin/perl /usr/bin/make /usr/local/bin/gmake /usr/bin/gcc 
 /usr/bin/cc
 GCC: Using builtin specs.
 gcc version 2.95.2 19991024 (release)
 Compilation info: CC='gcc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
 LIBC:
 -r--r--r--  1 root  wheel  1169450 Feb  6 12:05 /usr/lib/libc.a
 lrwxr-xr-x  1 root  wheel  9 Feb  6 12:05 /usr/lib/libc.so - libc.so.4
 -r--r--r--  1 root  wheel  559516 Feb  6 12:05 /usr/lib/libc.so.4
 Configure command: ./configure  --prefix=/usr/local/mysql-23.33 
 --with-low-memory
 Perl: This is perl, version 5.005_03 built for i386-freebsd

  
  
   Hi!
  
   The above happens as USER is a keyword in MySQL.
  
  
   Regards,
  
   Sinisa
  
  Sure, but this is a standard dump of the whole database, and the mysql
  client is having problems reloading the **mysql** database.  The mysql.db
  table defines this key, not one of my tables.  If you cannot use the
  --all-databases flag to mysqldump to make a valid backup file, what is the
  flag useful for?  :)
  
  By the way, this used to work.  I am not sure exactly what release it
  stopped working in.
  
  Thanks for the help.
  
  - Matt
  
  --
  Matt Loschert| email: [EMAIL PROTECTED]|
  Software Engineer   | web:   http://www.servint.net/ |
  ServInt Internet Services| phone: (703) 847-1381  |
  
  
  


It is not client bug, but a server bug.

We shall put on our TODO to fix that.


Regards,

Sinisa

    __ _   _  ___ ==  MySQL AB
 /*/\*\/\*\   /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
/*/ /*/ /*/   \*\_   |*|   |*||*| mailto:[EMAIL PROTECTED]
   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*| Larnaca, Cyprus
  /*/ /*/  /*/\*\_/*/ \*\_/*/ |*|
  /*/^^^\*\^^^
 /*/ \*\Developers Team

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manua

Re: mysqldump output file not valid as input file for mysql client

2001-02-22 Thread Matt Loschert

On Thu, 22 Feb 2001, Sinisa Milivojevic wrote:

 Matt Loschert writes:
   On Thu, 22 Feb 2001, Sinisa Milivojevic wrote:
  
[EMAIL PROTECTED] writes:
  Description:
 
As of mysql 3.23.33, a dumpfile generated with mysqldump (using the 
flags:
  --opt --all-databases) creates a file which will not be uploaded 
correctly
  using the mysql client (as in: 'mysql -u root -pXX -q -s  
dumpfile.sql').
 
Specifically, the problem relates to mysqldump's outputting of table 
keys.
  See the actual dump of mysql.db below:
 
  DROP TABLE IF EXISTS db;
  CREATE TABLE db (
Host char(60) binary NOT NULL default '',
Db char(64) binary NOT NULL default '',
User char(16) binary NOT NULL default '',
Select_priv enum('N','Y') NOT NULL default 'N',
Insert_priv enum('N','Y') NOT NULL default 'N',
Update_priv enum('N','Y') NOT NULL default 'N',
Delete_priv enum('N','Y') NOT NULL default 'N',
Create_priv enum('N','Y') NOT NULL default 'N',
Drop_priv enum('N','Y') NOT NULL default 'N',
Grant_priv enum('N','Y') NOT NULL default 'N',
References_priv enum('N','Y') NOT NULL default 'N',
Index_priv enum('N','Y') NOT NULL default 'N',
Alter_priv enum('N','Y') NOT NULL default 'N',
PRIMARY KEY (Host,Db,User),
KEY User(User)    pukes on this line
  ) TYPE=MyISAM COMMENT='Database privileges';
 
If a space is added (as in: "KEY User (User)"), the file will import 
correctly.
 
I looked through the source file mysqldump.c and it appears that there 
always
should be a space between the key name and the key columns, but my 
personal
dumpfiles show that all non-primary keys have no space between the key 
name
and the key column names.  Go figure. :)  Needless to say I don't get 
it.
 
  How-To-Repeat:
See above description.
  Fix:
See above description.
 
  Submitter-Id:submitter ID
  Originator:  Matt Loschert
  Organization:
 
Matt Loschert   | email: [EMAIL PROTECTED]  
  |
Software Engineer   | web:   http://www.servint.net/ |
ServInt Internet Services   | phone: (703) 847-1381  |
 
  
  MySQL support: none
  Synopsis:    mysqldump output file not valid as input file for mysql client
  Severity:non-critical
  Priority:medium
  Category:mysql
  Class:   sw-bug
  Release: mysql-3.23.33 (Source distribution)
 
  Environment:
 
  System: FreeBSD delft.servint.com 4.2-STABLE FreeBSD 4.2-STABLE #0: Tue Feb  
6 11:43:35 EST 2001 
[EMAIL PROTECTED]:/disk2/cvsup/branches/releng_4/obj/disk2/cvsup/branches/releng_4/src/sys/QUICKIE
  i386
 
 
  Some paths:  /usr/bin/perl /usr/bin/make /usr/local/bin/gmake /usr/bin/gcc 
/usr/bin/cc
  GCC: Using builtin specs.
  gcc version 2.95.2 19991024 (release)
  Compilation info: CC='gcc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
  LIBC:
  -r--r--r--  1 root  wheel  1169450 Feb  6 12:05 /usr/lib/libc.a
  lrwxr-xr-x  1 root  wheel  9 Feb  6 12:05 /usr/lib/libc.so - libc.so.4
  -r--r--r--  1 root  wheel  559516 Feb  6 12:05 /usr/lib/libc.so.4
  Configure command: ./configure  --prefix=/usr/local/mysql-23.33 
--with-low-memory
  Perl: This is perl, version 5.005_03 built for i386-freebsd
 
   
   
Hi!
   
The above happens as USER is a keyword in MySQL.
   
   
Regards,
   
Sinisa
  
   Sure, but this is a standard dump of the whole database, and the mysql
   client is having problems reloading the **mysql** database.  The mysql.db
   table defines this key, not one of my tables.  If you cannot use the
   --all-databases flag to mysqldump to make a valid backup file, what is the
   flag useful for?  :)
  
   By the way, this used to work.  I am not sure exactly what release it
   stopped working in.
  
   Thanks for the help.
  
   - Matt
  
   --
   Matt Loschert  | email: [EMAIL PROTECTED]|
   Software Engineer   | web:   http://www.servint.net/ |
   ServInt Internet Services  | phone: (703) 847-1381  |
  
  
  


 It is not client bug, but a server bug.

 We shall put on our TODO to fix that.


 Regards,

 Sinisa

Thanks, I appreciate the help.

- Matt

--
Matt Loschert   | email: [EMAIL PROTECTED]|
Software Engineer   | web:   http://www.servint.net/ |
ServInt Internet Services   | phone: (703) 847-1381  |



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manua

mysql hanging on mysqldump output

2001-02-07 Thread Lance Lovette

I am trying to copy data from one database to another using output from
mysqldump version 8.11 distributed with 3.23.28-gamma. The problem is that
part way through importing the data into the target database, mysql just
hangs. When I show the process list, there is only one query, and it's stuck
in the update state. The table it gets stuck on is the largest in my
database, the .MYD is 131M. The size of the .MYD stops at 49M during the
import.

First, I execute this to create the dump:

% mysqldump --host=xxx --user=xxx --password=xxx -C -q --opt xxx | gzip 
filename.sql.gz

Next, I execute this to import the data into the target database:

% gunzip --stdout filename.sql.gz | mysql xxx -u root -p

This never finishes. I have played with different mysqldump options and I
also tried importing the data into a 3.23.32 database and nothing works.
What else might I try?

Lance


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php