Begin forwarded message:
From: "Clayburn W. Juniel, III" <[EMAIL PROTECTED]>
Date: Fri Oct 4, 2002 10:24:06 America/Phoenix
To: "Clayburn W. Juniel, III" <[EMAIL PROTECTED]>
Subject: Re: Create table if not exists from mysqldump?
On Friday, Oct 4, 2002, at 08:48 America/Phoenix, Clayburn W. Juniel,
III wrote:
>
> 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.
Oops! That's not correct. That only works on creating the database
not the table. But since this is only a text file, what you can do is
use whatever program you have available and change every occurrence of
CREATE TABLE to CREATE TABLE IF NOT EXISTS. If someone sees a reason
why this won't work, please let me know.
--
Clayburn W. Juniel, III -- Effective Software Solutions
Phone: (602) 326-7707 Mobile: (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