I know nothing of DEB packages. However, when we need to change / make a
database etc on automatic scripts. We would write the script and save it
to a .sql file on console. We would then create a shell script that had
something like:

mysql -u <username> -p etc < yourinsertsql.sql

Essentially the username would have the ability to create tables/db's if
the DB does not exist already, so make sure the user exists first.

If you wanted to remove the DB afterwards, although if a DEB can do it,
ask first if you want to remove the DB. Have another .sql script with
essentially dropping the database. Then same again a shell that:

mysql -u <username> -p etc < yourremovesql.sql

This is of course assuming you can refer to a shell script in a DEB
package. But from what I have seen when using them, I would guess they
are used.

Hope this helped.

Dave

-----Original Message-----
From: Heston James - Cold Beans [mailto:[EMAIL PROTECTED] 
Sent: 01 October 2008 15:22
To: mysql@lists.mysql.com
Subject: Deployment of Database in a DEB package.

Afternoon All,

 

I'm hoping you'll have some recommendations for me on this little
challenge.
I have an application which we're preparing to deploy in a DEB package
using APT on Debian based systems, although I would imagine this very
same rule/process applies to other packaging methods.

 

On the back end of my application we have a MySQL Database which needs
to be created as part of the deployment process, which is automated in a
script, usually SHELL or Perl, something like that.

 

How would you deploy the database using an automated script? Would you
have a SQL script which you action through the console to create the
database?
What's the simplest way to action a SQL script to run on the local
server?
Do we need to keep in mind what permissions/users are assigned to the
database?

 

In addition to this create script, we'll also need to have an automated,
scripted process for removing the database if the package is removed,
I'd be interested to get your thoughts on that too.

 

Thanks in advance for any suggestions guys,

 

Heston



This message has been scanned for viruses by MailControl - (see
http://bluepages.wsatkins.co.uk/?6875772)


This email and any attached files are confidential and copyright protected. If 
you are not the addressee, any dissemination of this communication is strictly 
prohibited. Unless otherwise expressly agreed in writing, nothing stated in 
this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered 
in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, 
Surrey KT18 5BW. A list of wholly owned Atkins Group companies registered in 
the United Kingdom can be found at 
http://www.atkinsglobal.com/terms_and_conditions/index.aspx

Consider the environment. Please don't print this e-mail unless you really need 
to.

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

Reply via email to