Mariadb Episode 2

Mariadb Episode 2

Table of Contents

Mariadb Episode 2

Connect to your mariadb server:

mariadb -u root -p

You must know the user and password for your database server.

Create a New database:


MariaDB [(none)]> create database atulya_bank;
Query OK, 1 row affected (0.030 sec)

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| _311e8b965b7e2d81  |
| _69956230a083e3fd  |
| _76a8b160220c70d0  |
| atulya_bank        |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
8 rows in set (0.010 sec)

MariaDB [(none)]>use atulya_bank;

Other database are from Frappe.

Switch to the new database.

Get the sql file

Download commands.sql

Inside your mariadb console:

source path_to_commands.sql
MariaDB [atulya_bank]> source ./commands.sql
Query OK, 0 rows affected (0.174 sec)

Query OK, 0 rows affected (0.076 sec)

Query OK, 0 rows affected (0.116 sec)

Query OK, 15 rows affected (0.012 sec)
Records: 15  Duplicates: 0  Warnings: 0

Query OK, 15 rows affected (0.027 sec)
Records: 15  Duplicates: 0  Warnings: 0

Query OK, 20 rows affected (0.025 sec)
Records: 20  Duplicates: 0  Warnings: 0

MariaDB [atulya_bank]> 

Output:

MariaDB [atulya_bank]> show tables;
+-----------------------+
| Tables_in_atulya_bank |
+-----------------------+
| BankAccount           |
| Branch                |
| Customer              |
+-----------------------+
3 rows in set (0.067 sec)

SQL:

select * from Customer;

`

Tags :