mySQL / MariaDB - Create a new database

by
Jeremy Canfield |
Updated: June 05 2023
| mySQL / MariaDB articles
The create <database name> command can be used to create a new database. You will first need to log into your MariaDB or mySQL server or configure passwordless authentication and then use the -e command line option and the user must have the Create_priv.
create database mydatabase;
The show databases command can then be used to list the databases.
show databases;
Something like this should be returned.
+--------------------+
| Database |
+--------------------+
| information_schema |
| mydatabase |
| mysql |
| performance_schema |
+--------------------+
Did you find this article helpful?
If so, consider buying me a coffee over at