环境
Windows 7中VirtualBox上的Fedora 19和MariaDB
安装
百胜安装perl-SQL-Translator
脚步
通过以下方式生成转储:
[username@hostname ~] mysqldump -u root -pmysql_root_password database_name > example.sql
生成具有以下内容的图表:
[username@hostname ~] sqlt-graph -f MySQL -o example.png -t png example.sql
错误
ERROR (line 36): Invalid statement: Was expecting comment,
or use, or set, or drop, or create, or alter, or insert, or
delimiter, or empty statement
Error: translate: Error with parser 'SQL::Translator::Parser::MySQL':
no results at /usr/bin/sqlt-graph line 195.
链接
编辑
在第5行的以下SQL中也会发生错误:
DROP TABLE IF EXISTS `test_table`;
CREATE TABLE `test_table` (
`my_id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`my_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
LOCK TABLES `test_table` WRITE;
UNLOCK TABLES;
解决方法:
解决方案是仅导出模式的表定义.你的例子中的错误应该顺便说一句.不会发生在第五行,而是发生在第六行,该表被锁定以插入数据.
作为一种解决方案,无需数据即可转储架构,上面给出的示例可以执行以下操作以获取适用于童话的转储:
mysqldump -u root -pmysql_root_password --no-data database_name > example.sql
标签:mariadb,mysql,er-diagrams
来源: https://codeday.me/bug/20191030/1969184.html