|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
Background: ======= I am running a shell script from my perl script (web page). Shell script creates a file database.sql which then I use to create database and table structure. Code ==== Perl ----- my @output = system("install_my_profile.sh <parameters>"); Shell Script [install_my_profile.sh] -------------- echo -e $mysql>database.sql this gives error permission denied, I have changed directory ownership to apache:apache Please Regards Saurabh |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Am Wed, 02 Jan 2008 05:24:10 -0800 schrieb Saurabh:
> Hi, Hello, > Shell Script [install_my_profile.sh] > -------------- > echo -e $mysql>database.sql > > this gives error permission denied, I have changed directory ownership > to apache:apache Permission denied comes afaik from you database, you will the apache user in your database. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Saurabh wrote:
> > Background: > ======= > I am running a shell script from my perl script (web page). Shell > script creates a file database.sql which then I use to create database > and table structure. > > Code > ==== > Perl > ----- > my @output = system("install_my_profile.sh <parameters>"); > To debug add to your script: > Shell Script [install_my_profile.sh] > -------------- pwd echo "$mysql" set -x > echo -e $mysql>database.sql set +x > this gives error permission denied, I have changed directory ownership > to apache:apache -- Best regards | Be nice to America or they'll bring democracy to Cyrus | your country. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
@ Burkhard Ott : Thanks, but there Im just trying to write an file
with extention .sql so it cant be a issue of MySQL rights. @Cyrus Kriticos : Thanks, I took the decision to go other way, instead of writing the sql file where I was putting commands to create database and grant privileges and then running it in shell script. Now Iam not creating that file instead I do this mysqladmin -usuper -pduper create $profile [this creates database for profile] mysql -usuper -pduper -e "grant all on $profile.* to root@localhost identified by 'duper'" [this grants privileges] Thanks again, Saurabh On Jan 2, 7:20 pm, Cyrus Kriticos <cyrus.kriti...@googlemail.com> wrote: > Saurabh wrote: > > > Background: > > ======= > > I am running a shell script from my perl script (web page). Shell > > script creates a file database.sql which then I use to create database > > and table structure. > > > Code > > ==== > > Perl > > ----- > > my @output = system("install_my_profile.sh <parameters>"); > > To debug add to your script: > > > Shell Script [install_my_profile.sh] > > -------------- > > pwd > echo "$mysql" > set -x> echo -e $mysql>database.sql > > set +x > > > this gives error permission denied, I have changed directory ownership > > to apache:apache > > -- > Best regards | Be nice to America or they'll bring democracy to > Cyrus | your country. |
|
![]() |
| Outils de la discussion | |
|
|