我可以使用 MySQL Workbench 创建 MariaDB 吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22616861/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can I use MySQL Workbench to create MariaDB?
提问by TheOpti
I am totally new to databases. I would like to create a database; I am going to make a small project which is going to use DB. I am going to use Maria DB as it is totally free for commercial use.
我对数据库完全陌生。我想创建一个数据库;我将制作一个将使用 DB 的小项目。我将使用 Maria DB,因为它完全免费用于商业用途。
The question is: Can I use MySQL workbench program to create a database and then transform/change it to MariaDB?
问题是:我可以使用 MySQL Workbench 程序创建一个数据库,然后将其转换/更改为 MariaDB 吗?
回答by Tushar Sudake
From my experience -- Sure, you can use MySQL Workbench with MariaDB. However, I have tried basic functionalities only, like queries, schema design etc. Not sure about compatibility of advanced features.
根据我的经验——当然,您可以将 MySQL Workbench 与 MariaDB 一起使用。但是,我只尝试了基本功能,例如查询、架构设计等。不确定高级功能的兼容性。
回答by MonkeyPushButton
回答by user1607016
Yes, although connecting to view existing database on a remote MariaDB server will crash the current client (6.3.10). I use it mainly to deploy database models and that works fine, even on remote servers.
是的,尽管连接以查看远程 MariaDB 服务器上的现有数据库会使当前客户端 (6.3.10) 崩溃。我主要用它来部署数据库模型,即使在远程服务器上也能正常工作。
I just deployed to a MariaDB 10.3 server with that client and it worked fine, see screenshot.
我刚刚使用该客户端部署到 MariaDB 10.3 服务器,并且运行良好,请参见屏幕截图。
回答by danger89
So my experiences are, yes you can use MySQL Workbench for MariaDB database designs.
所以我的经验是,是的,您可以将 MySQL Workbench 用于 MariaDB 数据库设计。
However I needed to change the "Default Target MySQL Version" to 5.7
.
但是我需要将“默认目标 MySQL 版本”更改为5.7
.
This can be done by going to: Edit->Preferences in the menu. And finally to Modeling->MySQL.
这可以通过转到:菜单中的“编辑”->“首选项”来完成。最后到建模-> MySQL。
Since the latest MySQL version, v8.x, the SQL statements are not compatible with MariaDB statements (like creating an index). MariabDB creating an index on a table:
从最新的 MySQL 版本 v8.x 开始,SQL 语句与 MariaDB 语句不兼容(如创建索引)。MariabDB 在表上创建索引:
INDEX `fk_rsg_sub_level_rsg_top_level1_idx` (`rgs_top_level_id` ASC)
vs
对比
MySQL:
MySQL:
INDEX `fk_rsg_sub_level_rsg_top_level1_idx` (`rgs_top_level_id` ASC) VISIBLE
MariaDB can't handle this VISIBLE
keyword in this example. Using an old MySQL Version, MySQL Workbench will forward engineer a compatible MariaDB SQL file.
VISIBLE
在这个例子中,MariaDB 无法处理这个关键字。使用旧的 MySQL 版本,MySQL Workbench 将正向工程一个兼容的 MariaDB SQL 文件。
Currently (Oct 2019) the generated SQL_MODE output is still compatible with MariaDB. Just like InnoDB, which is also preferred when using MariaDB in most cases.
目前(2019 年 10 月)生成的 SQL_MODE 输出仍然与 MariaDB 兼容。就像 InnoDB 一样,在大多数情况下使用 MariaDB 时也是首选。