Re: MySQL Workbench 5.1.9 Beta available

Ugo Grandolini <[email protected]> Wed, 25 Mar 2009 08:45:08 +0100
Newsgroups gmane.comp.db.mysql.mycc
Message-ID <1237967108.11982.41.camel@maraja-xps1330>
On Mon, 2009-03-23 at 13:37 -0700, Daevid Vincent wrote:

> I'm disappointed to see that I STILL cannot connect to a remote database
> to reverse engineer the schema. :-(


as stated in the workbench-en.a4.pdf document:

The Community Edition (OSS)
The Community Edition is the foundation of all MySQL Workbench editions—
versions that are currently available or those that
will become available in the future. All editions of MySQL Workbench are
based on the Community Edition and all future improvements
to the base framework and feature set will be included in this version.
The Community Edition is a full feature product
that puts a powerful database management tool into the hands of the
MySQL community.

The Standard Edition
The Standard Edition is a commercial extension that builds on top of the
OSS Edition and adds modules and plugins, allowing for
an optimized work flow. The highlights of this edition are the added
schema object privilege system, schema validation plugins,
model reporting, and online printing, as well as reverse engineering and
synchronization against live database connections. If you
use the MySQL Workbench in a professional environment upgrading to the
commercial edition can greatly improve your work
flow.

Thus I guess we need to pay to be able to use this tool on a remote db.

I am wondering if SUN may change a bit these conditions allowing to
reverse engineer a db directly without having the need to prepare the
CREATE statements first. If not you may use mysqldump to prepare the
CREATE.sql file and the import it within WB.

I am also on Ubuntu and made a rough bash script (I am not confident
with bash) to automate the process:

#!/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin
#----------------------------------------
#	mysql CREATE statements backup
#
#	25 March 2009
#	http://phpcamaleo.org
#----------------------------------------
DATE=`/bin/date +%Y-%m-%d`

usage="\nSave only the CREATE statements of a MySQL database\n\n"
usage+="\tuse: mysql_dumpcreate.sh -p PATH -d DATABASE \n\n"
usage+="\t\t-p\tthe path where you want to save \n"
usage+="\t\t-d\tthe database name \n"

while getopts ":p:d:" opt
do
	case $opt in
		p  ) PATH=$OPTARG ;;
		d  ) DBNAME=$OPTARG ;;
		\? ) echo  $usage
		     exit 1
	esac
done
shift $(($OPTIND - 1))

#echo $OPTIND

if [ $OPTIND -ne 5 ]; then
	#
	#	show the help
	#
	echo -e $usage
	exit 1
fi 

FILE=$DBNAME

echo -e "Creating the database '"$DBNAME"' CREATE statements \nin:
'"$PATH/$FILE.create.sql"'"

if [ -f $PATH/$FILE.create.sql ]; then
	/bin/rm -f $PATH/$FILE.create.sql
fi
if [ -f $PATH/$FILE.create.log ]; then
	/bin/rm -f $PATH/$FILE.create.log
fi
if [ -f $PATH/$FILE.create.rar ]; then
	/bin/rm -f $PATH/$FILE.create.rar
fi
if [ -f $PATH/$FILE.create.rar.log ]; then
	/bin/rm -f $PATH/$FILE.create.rar.log
fi

#
#	IMPORTANT!
#
#		you may use a different character-set...
#
/usr/bin/mysqldump	--no-data \
					--default-character-set=utf8 --set-charset \
					--add-drop-table \
					--quote-names \
					--quick \
					-u {user name} -p{password} \
					$DBNAME \
					--log-error=$PATH/$FILE.create.log \
					> $PATH/$FILE.create.sql

#
#	uncomment the following to compress the output file: you need rar or
edit the code to compress in a different format
#
#echo "Compressing the output file " $PATH/$FILE.create.sql " to "
$PATH/$FILE.create.rar
#/bin/rar a -inul $FILE.create.rar $FILE.create.sql
#
#echo -e "Removing the source file " $PATH/$FILE.create.sql 
#/bin/rm $FILE.create.sql

echo -e "*** END OF JOB ***"

you can easily import the generated file in wb :)

have a nice day,
Ugo Grandolini