[plug] update a mysql script
Jon Miller
jlmiller at mmtnetworks.com.au
Sun Jan 1 15:23:51 WST 2006
Thanks for that, turns out that I did not need to do that after all just had to add some parameters and it worked ok so far.
Thanks and Happy New Year to Plug Members
Jon
>>> mike.gilks at westnet.com.au 4:38:03 pm 31/12/2005 >>>
On Saturday 31 December 2005 15:37, Jon Miller wrote:
> I have a file that creates a mysql database when I do the following:
> mysql <create.sql
> The database already exists, but I was told I need to re enter the command
> and now I'm getting the database already exist. Is there a way to running
> this command with some form or overwrite command or update command.
>
In the script 'create.sql' you probably have a line which says
create database somedb
or similar.
This needs to be changed to
create database if not exists somedb
then if the database is already there it will be ignored.
If you are creating tables in the same script you will have to do the same for
all the tables also.
See the documentation at
http://dev.mysql.com/doc/refman/4.1/en/create-database.html
Hope this helps.
Love
Mike.
_______________________________________________
PLUG discussion list: plug at plug.org.au
http://www.plug.org.au/mailman/listinfo/plug
Committee e-mail: committee at plug.linux.org.au
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20060101/2d675262/attachment.htm>
More information about the plug
mailing list