Skip to content

如何判断一个数据库是否已经存在? #9570

Answered by SteveYurongSu
xianzheTM asked this question in Q&A
Discussion options

You must be logged in to vote

通过

show databases 

或者

show database <database-name> 

的返回值判断。

1.0 / 1.1 的版本建议 database 数量为 1。

若想做区分,可以从 root.database.x 的 x 级开始区分。

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xianzheTM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants