Page MenuHomec4science

dbexec.in
No OneTemporary

File Metadata

Created
Mon, Jun 10, 00:07

dbexec.in

#!/bin/sh
# -*- mode: script; coding: utf-8; -*-
#
# This file is part of Invenio.
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
VERSION='$Id$'
MYSQL='@MYSQL@'
# DB config variables. These variables are to be set in invenio.conf
# by admins and then replaced in situ in this file by calling
# "inveniocfg --update-dbexec".
CFG_DATABASE_HOST='localhost'
CFG_DATABASE_PORT='3306'
CFG_DATABASE_NAME='invenio'
CFG_DATABASE_USER='invenio'
CFG_DATABASE_PASS='my123p$ss'
# is help called?
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echo "Usage: $0"
echo "General options:"
echo " -h, --help Print this help."
echo " -V, --version Print version information."
echo " -i, --interactive Bring inteactive SQL REPL. (default=batch-execute)"
exit 0
fi
# is version called?
if [ "$1" = "-V" ] || [ "$1" = "--version" ]; then
echo $VERSION
exit 0
fi
# interactive mode asked for?
if [ "$1" = "-i" ] || [ "$1" = "--interactive" ]; then
$MYSQL --default-character-set="utf8" --max_allowed_packet=1G --host="$CFG_DATABASE_HOST" --port="$CFG_DATABASE_PORT" --user="$CFG_DATABASE_USER" --password="$CFG_DATABASE_PASS" $CFG_DATABASE_NAME
else
$MYSQL -B --default-character-set="utf8" --max_allowed_packet=1G --host="$CFG_DATABASE_HOST" --port="$CFG_DATABASE_PORT" --user="$CFG_DATABASE_USER" --password="$CFG_DATABASE_PASS" $CFG_DATABASE_NAME
fi
# end of file

Event Timeline