Extract schema from MySQL using the included MySQL connector (output to /tmp/outdir/):
docker run -it --rm -v /tmp:/home/user/workdir tlvu/schemaspy \
-t mysql -o outdir -host <dbhost> -db <dbname> -u <dbuser> -p <dbuserpasswd> \
-dp ../pkg/mysql-conn.jar
The dbuser above only need to have select priviledge on the dbname.
To add such privilege:
echo "create user 'dbuser' identified by 'dbuserpasswd';
grant select on 'dbname'.* to 'dbuser'@'<fqdn hostname where this command
is being run>';" | mysql -h dbhost -u root -p
SchemaSpy help:
docker run -it --rm tlvu/schemaspy -h
To use an alternate JDBC driver than the provided ../pkg/mysql-conn.jar
(ex: for Postgres where the driver is not included or for a newer version
of the MySQL driver):
docker run -it --rm -v /tmp:/home/user/workdir \
-v /opt/mysqldriver:/opt/mysqldriver tlvu/schemaspy \
-t mysql -o outdir -host <dbhost> -db <dbname> -u <dbuser> -p <dbuserpasswd> \
-dp /opt/mysqldriver/mysql-conn.jar
Content type
Image
Digest
sha256:eda7d9ac4…
Size
271.5 MB
Last updated
almost 8 years ago
docker pull tlvu/schemaspy