Python MySQL Create Database

aimtocode

Create Database

To create a database in MySQL, we must use the "CREATE DATABASE" statement:

Example:



Check if Database Exists

We can check if a database is already created by listing all databases in your system by using the "SHOW DATABASES"statement:

Example:



Output:

  							   
 ('information_scheme',)
 ('mydatabase',)
 ('performance_schema',)
 ('sys',) 
aimtocode