query to see if database exists MySQL code example Example: python mysql check if database exists CREATE DATABASE IF NOT EXISTS DBName;