How to Create a MySQL Database on Linux via Command Line

banner dedicated

We will show you how to create a database in command line on a linux server with MySQL or MariaDB installed.

First you need to log your MySQL/MariaDB

mysql -u root -p

Create the database

In this example, we will create the database “example”


Check if your database is created

MariaDB> show databases;
| Database           |
| information_schema |
| example            |
| mysql              |
| performance_schema |
4 rows in set (0.00 sec)

banner dedicated

Colo-Serv Communications has written 32 articles

Premium Dedicated Hosting Services

Leave a Reply

Your email address will not be published. Required fields are marked *

one × 4 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>