After installing MySQL or MariaDB you can enter in mysqli command line by

sudo mysql

This is how you create a new database:

CREATE SCHEMA mydb;

See the list of databases in mysql server:

SHOW SCHEMAS;

Now you have access in the mydb schema because you are using the root user, if you want to create a new user so you can have acces in the database from an application(not safe to use root user) you have to create a new user

CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'password';

We use 'localhost' instead of the computer ip so we restrict the access in the local machine.

We can give now to the new user all the privileges to the database:

GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'localhost';

Here we used ALL PRIVILEGES beacause we need a user to take all control of the database, if we want to make different user with different privileges