mcImportMysql.sh 553 Bytes
#!/bin/bash
#
#       @package freeSN
#       @author dev@mensch.coop
#
. basepath.inc.sh
. "$__PATH_to_mcBash/include.inc.sh"

mc_h1 $0 $1 $2 $3
mc_parameter "1" "1" "$1" "mysql.sql.tar.gz import Datei"
mc_parameter "2" "1" "$2" "mysql Datenbank"
mc_parameter "3" "0" "$3" "mysql Benutzer"
mc_parameter "4" "0" "$4" "mysql Passwort"


if [ -z $3 ]  ; then
		user='root'
	else
		user=$3
fi

if [ -z $4 ]  ; then
		password=' -p '
	else
		password=" --password=$4 "
fi


tar -xzf $1 $__PATH_to_Temp/$1.sql
mc_bashsu "mysql -u $user $password $2 < $1.sql"