[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Problem med mysqladmin i bash script



Det er samme script jeg arbejder med endnu :)
Se tidligere postings.

++ mkpasswd qwerty
+ DBPASSWD=zs1CyM5tRJYcw
+ mysqladmin create tst98_tj_juac_dk -uroot -pzs1CyM5tRJYcw
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
+ echo 'The username of the database tst98_tj_juac_dk is root. And the password for the database is zs1CyM5tRJYcw'

Hvordan fikser man problemet med at mysqladmin fejlmelder når den køres som script? desuden kræver den password når den køres direkte fra kommandoprompten

Her er noget af koden:


mysqladmin koden:

DBPASSWD=`mkpasswd qwerty`
mysqladmin create ${UNDERSCORENAME} -uroot -p${DBPASSWD}
echo "The username of the database ${UNDERSCORENAME} is root. And the password for the database is ${DBPASSWD}" > "${DIR}/${LNK}.database.txt"


Håber på hjælp :)

Thomas :)

forresten hele koden er her:

#!/bin/bash
set -x
#
MNDOMN='juac.dk'
MNDOMNUNDERSCORE='Juac_dk'
IP=90.184.106.85
#
#for USRNME in /home/*
USRARRAY=$(ls -l --format=single-column /home/)
for USRNME in sslug@sslug
do
 DIR="/home/${USRNME}/PUBLIC_HTML"
 if [ ! -d ${DIR} ];
 then
  mkdir ${DIR}
 fi
# for USRDOMN in /home/${USRNME}/PUBLIC_HTML/*
 USRDOMNARRAY=$(ls -l --format=single-column /home/${USRNME}/PUBLIC_HTML/)
 for USRDOMN in sslug@sslug
 do
  LNK=${USRDOMN}.${USRNME}.${MNDOMN}
  UNDERSCORENAME=${USRDOMN}_${USRNME}_${MNDOMNUNDERSCORE}
  echo "USRDOMN:"${USRDOMN}
  echo "USRNME:"${USRNME}
if [ ! -e /home/${USRNME}/PUBLIC_HTML/${USRDOMN}.reserved -a -d /home/${USRNME}/PUBLIC_HTML/${USRDOMN} ];
   then	
   mkdir "/usr/lib/cgi-bin/${LNK}"	
   echo "<VirtualHost *:80>
 ServerAdmin sslug@sslug
 ServerName www.${LNK}
 ServerAlias ${LNK}
 DocumentRoot ${DIR}/${USRDOMN}
  # Set Document Root directory options
  <Directory />
    Options FollowSymlnks -Indexes Includes
    # Allow use of .htaccess file
    AllowOverride Limit FileInfo
  </Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/${UNDERSCORENAME}
  # Set CGI-BIN directory options
  <Directory /cgi-bin>
    AllowOverride None
    Options +ExecCGI -Multiviews +SymlnksIfOwnerMatch
    Order allow,deny
    Allow from all
  </Directory>
 CustomLog /var/log/apache2/access.log common
 ErrorLog /var/log/apache2/error.log
</VirtualHost>" > "/etc/apache2/sites-available/${UNDERSCORENAME}"
  /usr/sbin/a2ensite ${UNDERSCORENAME}
  echo "${IP} WWW.${LNK} ${LNK}" >> /etc/hosts
  #/etc/init.d/apache2 stop
  #/etc/init.d/apache2 start
  /usr/sbin/apachectl configtest && /usr/sbin/apachectl graceful
  DBPASSWD=`mkpasswd qwerty`
  mysqladmin create ${UNDERSCORENAME} -uroot -p${DBPASSWD}
echo "The username of the database ${UNDERSCORENAME} is root. And the password for the database is ${DBPASSWD}" > "${DIR}/${LNK}.database.txt"
  touch /home/${USRNME}/PUBLIC_HTML/${USRDOMN}.reserved
  fi
 done
done


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2011-05-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *