- 全ページのバックアップ一覧
- テーブル定義書を作成する のバックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- ソース を表示
- テーブル定義書を作成する へ行く。
- 1 (2013/02/18 (月) 12:34)
#!/bin/sh ## base config
MYSQL_HOME=mysql
MYSQL_USER=root
MYSQL_PASSWD=passwd
CSS_FILE_NAME="style.css"
## dbif [ "$1" = "" ]; then
DB_NAME=mysql
else
DB_NAME=$1
fi
OUTPUT=$DB_NAME.html
## tableMYSQL="$MYSQL_HOME -u $MYSQL_USER -p$MYSQL_PASSWD $DB_NAME"
## export html
TABLES=`echo "show tables;" | $MYSQL -s`echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">" > $OUTPUT
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">" >> $OUTPUT
echo "<head>" >> $OUTPUT
echo "<title>Mysql DB Document : $DB_NAME</title>" >> $OUTPUT
echo "<link rel=\"stylesheet\" href=\"$CSS_FILE_NAME\" type=\"text/css\" />" >> $OUTPUT
echo "</head>" >> $OUTPUT
echo "<body>" >> $OUTPUT
echo "<h1>Mysql DB Document : $DB_NAME</h1>" >> $OUTPUT
for TABLE_NAME in $TABLES;
do
TABLE_STATUS=(`echo "show table status like '$TABLE_NAME'" | $MYSQL -s`) echo "<h3>$TABLE_NAME : ${TABLE_STATUS[18]}</h3>" >> $OUTPUT echo "show full columns from $TABLE_NAME;" | $MYSQL -H >> $OUTPUT
done
echo "</body>" >> $OUTPUT
echo "</html>" >> $OUTPUT