Re: Create table if not exists from mysqldump?

2002-10-04 Thread swati sandhya

Hi,

Do u mean when u take a dump you need to add before
each table drop table if exists

then here is the command.

mysqldump -uusername -p -hhostname
--add-drop-table databasename tablename  test.sql

regards,
Praveen
--- John Kelly [EMAIL PROTECTED] wrote:
 Hi, I am trying to use mysqldump to dump the
 structure of a single database
 and want the output to make create table commands
 that include the IF NOT
 EXISTS switch so that when the file is imported into
 an existing database it
 does not write over tables with the same name. Does
 anyone know if this is
 possible with mysqldump and if so what option
 achieves this? Thanks.
 

-
 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
 


__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-
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: Create table if not exists from mysqldump?

2002-10-04 Thread Gerald R. Jensen

Or your could ...

mysqldump -uusername -p -hhostname --all --add-drop-table --add-locks --
complete-insert --compress --extended-insert --flush-logs --force --opt --ve
rbose --databases databasename tablename  test.sql


- Original Message -
From: swati sandhya [EMAIL PROTECTED]
To: John Kelly [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, October 04, 2002 5:19 AM
Subject: Re: Create table if not exists from mysqldump?


Hi,

Do u mean when u take a dump you need to add before
each table drop table if exists

then here is the command.

mysqldump -uusername -p -hhostname
--add-drop-table databasename tablename  test.sql

regards,
Praveen
--- John Kelly [EMAIL PROTECTED] wrote:
 Hi, I am trying to use mysqldump to dump the
 structure of a single database
 and want the output to make create table commands
 that include the IF NOT
 EXISTS switch so that when the file is imported into
 an existing database it
 does not write over tables with the same name. Does
 anyone know if this is
 possible with mysqldump and if so what option
 achieves this? Thanks.


-
 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



__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-
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




-
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: Create table if not exists from mysqldump?

2002-10-04 Thread Victoria Reznichenko

John,
Friday, October 04, 2002, 6:41:46 AM, you wrote:

JK Hi, I am trying to use mysqldump to dump the structure of a single database
JK and want the output to make create table commands that include the IF NOT
JK EXISTS switch so that when the file is imported into an existing database it
JK does not write over tables with the same name. Does anyone know if this is
JK possible with mysqldump and if so what option achieves this? Thanks.

You can't.

You can add DROP TABLE before each CREATE table statement using
--add-drop-table option. You can run mysql with --force option when
you restore tables from dump file.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com





-
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: Create table if not exists from mysqldump?

2002-10-04 Thread Clayburn W. Juniel, III


On Thursday, Oct 3, 2002, at 20:41 America/Phoenix, John Kelly wrote:

 Hi, I am trying to use mysqldump to dump the structure of a single 
 database
 and want the output to make create table commands that include the IF 
 NOT
 EXISTS switch so that when the file is imported into an existing 
 database it
 does not write over tables with the same name. Does anyone know if 
 this is
 possible with mysqldump and if so what option achieves this? Thanks.

add the option -n or --no-create-db.   This will add IF NOT CREATE to 
the sql.

--
Clayburn W. Juniel, III -- Effective Software Solutions
Phone: (602) 326-7707Mobile: (602)326-7707
Email: [EMAIL PROTECTED]
http://EffectiveSoftwareSolutions.com
--


-
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