3.3 creating database in MYSQL
v Creating Database: -
Ø To create a
database in MySQL, first we should connect to MySQL server and create a cursor(
) object then pass SQL command as a string to the execute( ) method.
Ø The SQL command to create database with python code is:
Example: -
Output: -
Ø We can check if a database exists in the system or not , by using the “show databases” command.