#!/bin/sh # # Connect to a database from the command line. DB is specified # in ../site_vars.phtml. # # Part of the ModerMethod Standard Library # # (C) Copyright 2002 ModernMethod, Inc. . `dirname $0`/parse_vars load_config_file if [ "$db_type" != "mysql" ]; then echo backup_db only supports MySQL presently exit 1 fi # Find a suitable MySQL command line client for file in /usr/bin/mysql /usr/local/bin/mysql /usr/local/mysql/bin/mysql do if [ -x $file ]; then mysql=$file fi done $mysql --user=$db_user --password=$db_pw --host=$db_host $db_db