Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 uid=99(nobody) gid=98(nobody) groups=98(nobody) Safe-mode: OFF (not secure) /home/makras/public_html/db_admin/scripts/ drwxr-xr-x | |
| Viewing file: Select action/file-type: #!/bin/sh
#
# inno2pma
#
# insert InnoDB foreign keys into phpmyadmin relation table
# by Ernie Hershey 3/15/2003
#
# THIS IS AN EXPERIMENTAL SCRIPT - PLEASE DO NOT USE THIS
# IF YOU DON'T UNDERSTAND WHAT IT IS DOING!
#
# This was posted on the Open Discussion forum by
# ehershey. The idea is interesting, however we should
# implement it in PHP.
#
# In future versions of phpMyAdmin the use of a proprietary
# storage of relational tables will be discarded in favor of
# the InnoDB relations (or in addition to). Support of InnoDB
# relations is on our ToDo-List.
#
# requires :
# mysql client tools
# standard unix shell tools
# special PHPMyAdmin relation table setup
#
#
# config
database="triohost2"
#table="domains"
relationdb="phpmyadmin"
relationtable="PMA_relation"
# end config
mysqldump --no-data $database $table | egrep "^CREATE|^ FOREIGN" | while read line
do
line=`echo "$line"|sed 's/^ *//g`
first_token=`echo "$line" | cut -f1 -d" "`
case $first_token in
CREATE)
table_name=`echo "$line"|sed 's/CREATE TABLE \(.*\) (/\1/'`
echo "DELETE FROM $relationtable WHERE master_db='$database' AND master_table='$table_name'" | mysql $relationdb
;;
FOREIGN)
localcolumn=`echo "$line" | cut -f2 -d\\\``
foreigntablefull=`echo "$line" | cut -f4 -d\\\``
foreigndb=`echo $foreigntablefull | cut -f1 -d.`
foreigntable=`echo $foreigntablefull | cut -f2 -d.`
foreigncolumn=`echo "$line" | cut -f6 -d\\\``
echo processing foreign key on column $database.$table_name.$localcolumn to $foreigndb.$foreigntable.$foreigncolumn >&2
echo "INSERT INTO $relationtable VALUES ('$database','$table_name','$localcolumn','$foreigndb','$foreigntable','$foreigncolumn');" | mysql $relationdb
;;
esac
done |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0044 ]-- |