Skip to main content

Posts

Showing posts from March, 2018

How to Create Database in MySQL or Mariadb

<<Back to MySQL & MariaDB Main Page Creating a Database in MySQL or Mariadb Command to create a database in MySQL or MariaDB is same and is super easy. All that you need to know to create a database is collation_name charset_name db_name Lets quickly have a look at help manual of create database. I am going to create a new database called provisioning_wdcee. I already have the character set and collation_name with me. MariaDB> CREATE DATABASE `provisioning_wdcee` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ; Once the database is created we can quickly verify the presence of the database. you can issue show databases like 'provisioning_wdcee'; as shown above. You can also check for the existence of folder dedicated for this database in you datadir directory Now you need to create the user and allow the access on this database to access the database from outside of the box. Creating an user in mysql will be discussed later in a separat

How to drop a Database in Mysql or MariaDB

<<Back to MySQL & MariaDB How To Page Dropping a Database in Mysql or MariaDB It is always easy to destroy anything than to setup/build/create or manage. So Let's why not try it out for MySQL or MariaDB Step1> Check the database, supposed to be dropped, exists. I want to drop tokenization_global database MariaDB [(none)]> show databases like '%tokenization_glo%'; Step2> Drop the database MariaDB [(none)]> drop database tokenization_global; You may ask you 14 rows affected. Its because there was 14 table in this database. Now lets check if the database no more exists. use show database command to check this.

How to Import Database in MySQL or MariaDB with Different Name

<<Back to MySQL & MariaDB How To Page Importing Database in MySQL or MariaDB with Different Name Importing a database in Mysql and/or MariaDB is super easy. If you have export dump with you follow the steps below. See also  How To Export a Single Database from MySQL or MariaDB if you have not exported the database yet. Note:- MySQL and MariaDB is 100% compatible to each other and therefore the export taken from MySQL can be imported in MariaDB and vice verse. In this demonstration I will import the database dump taken in How To Export a Single Database from MySQL or MariaDB  post from mysql Instance into MariaDB instance. Step1> Edit the dumpfile with suitable editer and locate the following contents -- -- Current Database: ` test ` -- CREATE DATABASE /*!32312 IF NOT EXISTS*/ ` test ` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */; USE ` test `; Step2> Replace the database name with desired name. In this example I have replaced test wit

How To Import a Single Database in MySQL or  MariaDB

<<Back to MySQL & MariaDB How To Page Importing a Single Database in MySQL or MariaDB Importing a database in Mysql and/or MariaDB is super easy. If you have export dump with you follow the steps below. See also  How To Export a Single Database from MySQL or MariaDB if you have not exported the database yet. Note :- MySQL and MariaDB is 100% compatible to each other and therefore the export taken from MySQL can be imported in MariaDB and vice verse. In this demonstration I will import the database dump taken in   How To Export a Single Database from MySQL or MariaDB  post. from mysql Instance into MariaDB instance. Step1> Login to your target database instance and check if the database name to be imported ( test ), exists or not. In case DB Name already exists you need to rename the database while importing. See How to Import Database in MySQL or MariaDB with Different Name  [root@host]# mysql Welcome to the MariaDB monitor.  Commands end with ; or \g. Your M

How To Export a Single Database from MySQL or  MariaDB

<<Back to MySQL & MariaDB How To Page Export a Single Database from MySQL or  MariaDB Exporting the database in MySQL or MariaDB is rally easy and there is no difference. As you can see below mysqldump utility is available in both MySQL as well as MariaDB. Although there are various tools to do this I will be using mysqldump. Los gehts Step1> Login to your MySQL or MariaDB instance type show databases to list the databases running I want to perform the export of TEST database. [root@host~]#  mysql Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 58921 Server version: 5.1.73-log Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. m

Understanding Indepth of Cassandra Gossip Protocol

<<Back to Cassandra Main Page What is Gossip Protocol. A peer-to-peer communication protocol to discover and share location and state information about the other nodes in a Cassandra cluster. Understanding Indepth of Cassandra Gossip The gossiper is responsible for making sure every node in the system eventually knows important information about every other node's state, including those that are unreachable or not yet in the cluster when any given state change occurs. Gossip timer task runs every second. This means that a node initiates gossip exchange with one to three nodes every second (round) or ( zero if it is alone in the cluster). Information to gossip is wrapped in an ApplicationState object in a key/value pair. The information exchanged in a GossipMessage looks something like below. HeartBeatState Each node in Cassandra has one HeartBeatState associated with it which Consists of generation and version number. Generation grows at every time the node is

Cassandra - Importent Key Components

<<Back to Cassandra Main Page Importent Key Components/Terminologies for configuring Cassandra Following are must know terminology before you start diving deep into Cassandra. I will explain each of them seprately in more details in my folowing posts as and when it will be required. For the time being it is enough to know them and what they are used for Gossip A peer-to-peer communication protocol to discover and share location and state information about the other nodes in a Cassandra cluster. Partitioner A partitioner determines which node will receive the first replica of a piece of data, and how to distribute other replicas across other nodes in the cluster Replication factor Replication factor defines the redundancy of the data. A replication factor of 1 means that there is only one copy of each row.  A replication factor of 2 means two copies of each row, where each copy is stored on a different node. The replication factor is defined for each datacenter, in

Cassandra – Architecture

<<Back to Cassandra Main Page Cassandra – Architecture The design goal of Cassandra is to handle big data workloads across multiple nodes as well as to provide high availability without any single point of failure. Cassandra stores data on different nodes with a peer-to-peer distributed fashion architecture. All the nodes exchange information with each other using Gossip protocol Components of Cassandra Following are the key components of Cassandra Node - Node is the place where data is stored. It’s the basic component of Cassandra Data Center - ( Replication group) In Cassandra, collection of related nodes are called datacenter. Cluster - Cluster is collection of many datacenters Commit Log - Every write operation is written to commit log. Commit Log provides commit recovery mechanism. (It can be compared with redo logs in oracle)   Mem-table - Data is written to Mem-table after Commit Log. Data written to Mem-table are temporary. SSTabl

Cassandra - Introduction

<<Back to Cassandra Main Page Cassandra - Introduction What is Cassandra Apache Cassandra is a NoSQL Database. It is highly scalable, high-performance and distributed database designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. In the definition we used many terms like NoSQL, Commodity Server etc. Let us understand these terminology one by one to understand the Cassandra definition NoSQL Database A NoSQL database is a database that provides a mechanism to store and retrieve data in non-relational format (as oppose to RDBMS Database) These databases are schema free, can handle huge amount of data and support easy replication to support fault tolerance. NoSQL Database does not support transactions and it is eventually consistent (while RDBS database follows ACID (Atomicity, Consistency, Isolation, and Durability)). Beside Cassandra there are many NoSQL database platforms available in the