Re: rentering a sql script

2005-12-31 Thread David Logan

Jon Miller wrote:


I have a sql script that needs to be re entered using the following command mysql 
 create.sql but the database already exists.  IS there a way to overwrite or 
update the database using the script, or do I have to delete the existing database?
 




!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=Content-Type content=text/html; charset=us-ascii
META content=MSHTML 6.00.2900.2802 name=GENERATOR/HEAD
BODY style=MARGIN-TOP: 2px; FONT: 10pt Arial; MARGIN-LEFT: 2px
DIVI have a sql script that needs to be re entered using the following command 
mysql lt; create.sql but the database already exists.nbsp; IS there a way to 
overwrite or update the database using the script, or do I have to delete the 
existing database?/DIV

DIVnbsp;/DIV
DIVnbsp;/DIV/BODY/HTML

 





 


Hi Jon,

You will have to drop the database first if you wish to start from 
scratch. If you wish to update the records, the syntax at 
http://dev.mysql.com/doc/refman/5.0/en/create-database.html would be 
useful, especially the IF NOT EXISTS bit. This will allow you to bypass 
the CREATE DATABASE requirement. You may also use a similar syntax for 
the CREATE TABLE statement.


Regards

--

David Logan
South Australia

when in trouble, or in doubt
run in circles, scream and shout



rentering a sql script

2005-12-30 Thread Jon Miller
I have a sql script that needs to be re entered using the following command 
mysql  create.sql but the database already exists.  IS there a way to 
overwrite or update the database using the script, or do I have to delete the 
existing database?
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=Content-Type content=text/html; charset=us-ascii
META content=MSHTML 6.00.2900.2802 name=GENERATOR/HEAD
BODY style=MARGIN-TOP: 2px; FONT: 10pt Arial; MARGIN-LEFT: 2px
DIVI have a sql script that needs to be re entered using the following 
command 
mysql lt; create.sql but the database already exists.nbsp; IS there a way to 
overwrite or update the database using the script, or do I have to delete the 
existing database?/DIV
DIVnbsp;/DIV
DIVnbsp;/DIV/BODY/HTML


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