CategoryDatabases

MySQL an introduction and basic tutorial

MySQL is a Open source database management systems. It ‘s a powerful database management system with a lot of flexibility. This tutorial covers basic introduction to MySQL. In this tutorial I’m using Centos operating system for installing MySQL.

Installing MySQL in centos

MySQL can be installed using yum repository, and can be installed using the below comment.

#yum install mysql-server

image

Once the installation is complete, you can start mysql using the below comment.

#/etc/init.d/mysqld start

No password is set by default during MySQL installation.

For setting up password for MySQL for the first time use mysqladmin to set root password

mysqladmin -u root password NEWPASSWORD

eg: mysqladmin –u root password Password123

Accessing MySQL Shell

MySQL prompt can be accessed using the below command

#mysql –u root –p

and enter the MySQL password created.

image

Now we are in MySQL prompt.

How to list databases?

type ‘show databases’ at mysql prompt.

image

How to create a database?

Syntax: create database <dbname>

image

How to access a database?

Syntax: use <dbname>

image

How to delete a database?

Syntax: drop database <dbname>

image

Most commonly used opensource databases

Almost all developers has his/her own favorite databases, here I’m going have a small insights on the commonly used Opensource databases.

Here’s the list of most commonly used Opensource databases

  • MySQL
  • PostgreSQl
  • MongoDB
  • SQLite

There are a  lot more databases, here I’m planning have a short intro on the above mentioned databases.

MySQL

According to wikipedia,

“MySQL is the world’s most widely used open-source Relational Database Management Systems (RDMS) that runs as a server providing multi-user access to a number of databases.”

MySQLThe MySQL development project has made its source code available under the terms of the GNU General Public License.  MySQL was owned and sponsored by a Swedish company MySQLAB, now owned by Oracle Corporation.

MySQL downloads can be obtained from http://www.mysql.com/downloads/

The latest version of MySQL is MySQL 5.6, the latest whitepaper on MySQL can be obtained from http://www.mysql.com/why-mysql/white-papers/whats-new-mysql-5-6/

PostgreSQL

PostgreSQL is a powerful, opensource object-relational database system. It runs on all major operating systems, including Linux, Windows, Unix flavours such as AIX, BSD, HP-UX. It is fully ACID compliant, has full support for foreign keys, joins, views, triggers, and stored procedures (in multiple languages).

PostgreSQL It includes most SQL:2008 data types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. It also supports storage of binary large objects, including pictures, sounds, or video.

Some general PostgreSQL limits are included in the table below.

              Limit  Value
Maximum Database Size Unlimited
Maximum Table Size 32 TB
Maximum Row Size 1.6 TB
Maximum Field Size 1 GB
Maximum Rows per Table Unlimited
Maximum Columns per Table 250 – 1600 depending on column types
Maximum Indexes per Table Unlimited

PostgreSQL can be download here for free.

MongoDB

mongoMongoDB (from “humongous”) is an open-source document database, and the leading NoSQL database. Written in C++, MongoDB features:

  • Document-Oriented storage: JSON styled documents with dynamic schemas offer simplicity and power
  • Replication and High Availability
  • Auto -sharding: Scale without affecting functionality.
  • Querying: Rich, document based queries.
  • And more

Latest releases can be downloaded from here

SQLite

sqliteSQLite is a software library that implements a self-containedserverless,zero-configurationtransactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world.

And the downloads can be obtained from here.

Working with Oracle HTTP Server

In this blog i’m covering some basics on Oracle HTTP server(OHS) like

  • Checking OHS status.
  • Starting, stopping and restarting OHS.
  • Creating an Oracle HTTP server component.
  • Deleting an Oracle HTTP server component.

Checking OHS Status

We can determine the status of OHS by using the opmnctl command

$ORACLE_INSTANCE/bin/opmnctl status

Processes in Instance: instance1
---------------------------------+--------------------+---------+---------+-------
ias-component                    | process-type       |     pid | status | Ports
---------------------------------+--------------------+---------+---------+-------
ohs1                             | OHS                |    4789 | Alive  | https:1000, https:4444, http:7778

Starting, Stopping and restarting OHS

To Start use: >$ORACLE_INSTANCE/bin/opmnctl startall

To Stop use:  >$ORACLE_INSTANCE/bin/opmnctl stopproc process-type=OHS   or use  $ORACLE_INSTANCE/bin/opmnctl stopall

To restart: all Oracle HTTP Server components use: $ORACLE_INSTANCE/bin/opmnctl restartproc process-type=OHS

Creating an Oracle HTTP server component

The syntax for creating a Oracle HTTP server component is

$ORACLE_INSTANCE/bin/opmnctl createcomponent -componentType OHS -componentName component_name

For eg: to create an Oracle HTTP Server component named ohs1, use the following command:

>$ORACLE_INSTANCE/bin/opmnctl createcomponent -componentType OHS -componentName ohs1

When you create the Oracle HTTP Server component, ports are automatically assigned. However, you can use the following parameters to specify the ports of your choice:

-listenPort: HTTP listening port
-sslPort: HTTPS (SSL) listening port
-proxyPort: Proxy MBean port internally used by Oracle HTTP Server to communicate with Fusion Middleware Control

Deleting an Oracle HTTP server component

The syntax for deleting an Oracle HTTP server component using opmnctl is

>$ORACLE_INSTANCE/bin/opmnctl deletecomponent -componentName component_name

For eg: to delete an Oracle HTTP Server component named ohs1 use the following command:

>$ORACLE_INSTANCE/bin/opmnctl deletecomponent -componentName ohs1

 

© 2017 My techbook

Theme by Anders NorénUp ↑