How do you create and setup a MySQL database.

  Databases

Imagine you need to create a new database for some project like a simple blog, and you plan to do that with MySQL. So, in that case all you need is to install MySQL/MariaDB and, after MySQL server is up and running, you can connect to it as the superuser root with the mysql client and create the database and user.

On Linux, enter the following command at the command line terminal.

shell> mysql -u root -p

On Windows, click Start, All Programs, MySQL, MySQL 5.7 Command Line Client.

C:\> mysql -u root -p

After you log in you can create a simple database and user like this :

CREATE DATABASE name_you _want_for_the_database; ;
CREATE USER 'user_you _want_for_the_database;'@'host_where_is_the_database' IDENTIFIED BY 'password_you _want_for_the_user_database;';
GRANT ALL PRIVILEGES on name_you _want_for_the_database;.* TO 'user_you _want_for_the_database'@'host_where_is_the_database;' identified by 'password_you _want_for_the_user_database;';
FLUSH PRIVILEGES;

And thats it, now you are ready to start your project.