Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
#!/bin/sh
# File: mysql-exec.sh
# Changes:
# 20010224 Ola Lundqvist
# 20010322 Ola Lundqvist
# Fix for exec output.
# 20011022 Luca De Vitis
# Introduced the error variable.
# 20020116 Ola Lundqvist
# Documented the error variable.
# 20020125 Ola Lundqvist
# Added new status code.
# 20020126 Ola Lundqvist
# Corrected the documentation about what this file does.
# 20031027 Benoit Joly
# Patch small bug.
# 20040205 Jeroen van Wolffelaar
# Check merely for valid account, rather than for access to the
# mysql-database, so also regular mysqlusers can be used
# 20040705 Jeremy Laine
# Better check for mysql client command.
# Needs: $dbname - the database that user should have access to (optional)
# $dbserver - the server to connect to.
# $dbadmin - the databaseuser name.
# $dbadmpass - the databaseuser password.
# which
# mysql
# $sqlfile - the file containing the SQL statements to run.
# /usr/share/wwwconfig-coomon/mysql.get
# Description: Connect to mysql and run a sql script.
# Sets: $status = {error, exec, execerror}
# $error = error message (if $status = error)
status=error
error=""
. /usr/share/wwwconfig-common/mysql.get
if [ -z "$dbserver" ] ; then
error="No database server specified."
elif [ -z "$dbadmin" ] ; then
error="No database administrator specified."
elif [ -z $(which mysql) ] ; then
error="No mysql client to execute, install the mysql client package and
run 'dpkg-reconfigure -plow packagename'."
elif ! eval $mysqlcmd /dev/null 2>&1 ; then
error="Error when trying to connect to the mysql database.
This error can occur if you have no database to connect to, or
if the password was incorrect.
use: dpkg-reconfigure -plow packagename to reconfigure."
else
log="${log}Executing command to mysql."
if eval $mysqlcmd -f $dbname < $sqlfile > /dev/null 2>&1 ; then
status=exec
else
status=execerror
error="Unable to run the sql script ($sqlfile)."
fi
fi