N
N
Neonoviiwolf2016-10-23 20:07:47
MySQL
Neonoviiwolf, 2016-10-23 20:07:47

How to check if a database exists?

Kind
Question such as to check up, whether the necessary DB already exists on the device? It is a database, not tables
As a crooked option, always create a database at startup, if it exists, then catch an exception, but this is somehow stupid

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2016-10-23
@Neonoviiwolf

Connect and command
There will be a line in the answer - it means there is a database. Empty means none.
Plus, create database has idempotent behavior
dev.mysql.com/doc/refman/5.7/en/create-database.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question