Setting Up Database

Let’s assume that you already installed a free MariaDB or MySQL and downloaded its Sample Database at /mysql/mysqlsampledatabase.sql. Here is an example of how you may set up your classic database.

c:\Program Files\MariaDB 10.5\bin>mysql -u root -p

Import the sample database by entering the command:

MariaDB [(none)]> source /mysql/mysqlsampledatabase.sql

It will install the database “classicmodels” that you can see after entering the command:

MariaDB [classicmodels]> show databases;
+--------------------+
| Database           |
+--------------------+
| classicmodels      |
| information_schema |
| mysql              |
| performance_schema |
| test               |
+--------------------+

Now create a user “sample” with the password “sample”:

MariaDB> create user 'sample'@'localhost' identified by 'sample';

Grant the user ‘sample’ all privileges:

MariaDB> grant all privileges on classicmodels.* to 'sample'@'localhost';

You are ready to work with this database.

When you want to use this database, you need to start is by doing the following:

  1. In windows Start menu type ‘services’ in the search bar
  2. Scroll down to find ‘MariaDB (version), right-click on it, and choose ‘Start the service’.
Design a site like this with WordPress.com
Get started