Mailinglist Archive: opensuse-buildservice (131 mails)

< Previous Next >
[opensuse-buildservice] storing mysql root password
  • From: Manuel Arostegui Ramirez <manuel@xxxxxxxxxxxxxx>
  • Date: Wed, 20 Dec 2006 16:23:49 +0100
  • Message-id: <200612201623.50090.manuel@xxxxxxxxxxxxxx>
Hi all.
I´m packing an application which has got some .sql to configure database.
When you download the tar.gz you have to run the sql by hand, of course, and
all tables, and databases are created.
Well, I would like to make that process automatically when the rpm is being
installed.

As all of you could imagine to run the sql you must be root and know root
password of the mysql server, so, I have no idea about how to ask for the
root of the mysql when rpm -i foo.rpm is done.
I mean, I would like to store the root password (I´ve been thinking that could
be done with "expect") to use it with later, so then, the application will be
installed and the databases will be set up correctly, cause I don´t want
users to install the rpm and after that run by hand the sql file.

The command I shoudl run is:

cat pandoradb.sql | mysql -D pandora -u root -p
cat pandoradb_data.sql | mysql -D pandora -u root -p

Any ideas of what to do with the spec file?
Thanks in advance.
--
Manuel Arostegui Ramirez.

Electronic Mail is not secure, may not be read every day, and should not
be used for urgent or sensitive issues.
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >