background img
banner
Dec 1, 2014
418 Views
0 0

MySQL an introduction and basic tutorial

Written by
banner

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

Article Tags:
· ·
Article Categories:
Databases · MySQL
banner

Comments to MySQL an introduction and basic tutorial

  • It would be better if you add details for Ubuntu also. Thanks

    Hosting Fever March 17, 2016 9:28 pm Reply

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.