how to Create, drop and rename of mysql database

how to Create, drop and rename of mysql database

How To Create DATABASE

The SQL CREATE DATABASE statement is used by a developer to create a database.

Let’s see the Example of CREATE SQL DATABASE:



SQL DROP statement is used By Developers to delete or remove the database.
If you want to delete or drop an existing database in a SQL than you can use SQL DROP DATABASE statement.

Let’s see the example of SQL DROP DATABASE:


If you delete or drop the database, all the tables and views will also be deleted. So be careful while drop Your SQL database.

How To Rename DATABASE

Sometimes you need to change the name of your database because of the original name was not more relevant to the data. Or, you just want to give a temporary name to that data for easy to remember.
SQL RENAME DATABASE statement is used to change the name of a database.

Let’s see the example of SQL Rename DATABASE:

RENAME DATABASE old_db_name TO new_db_name;

You Can Also use following command to change name of your database.

ALTER DATABASE old_name MODIFY NAME = new_name

Leave a Reply

Related Posts: You may like

How to remove whitespace from string using php

Remove All Special Characters From String PHP

comma separated values in mysql query

SQL statement to retrieve names beginning with A


Crypto Currency

PHPKIDA provides free online the best real-time crypto market price, news, predictions, index with graphs & historical data for 2000+ coins including bitcoin, ethereum, & altcoins from major cryptocurrency exchanges.

Visite Tool

Icon Generator

PHPKIDA provides free online icon generator. Our icon generator help you to edit, modify, resize and customize icon for your website and applications. Convert to a shap you like add icon border, you can change icon border color, border size, background color, icon shadow, icons color, icon size in your own way and save it as a png image.

Visite Tool

Youtube Video Downloader

PHPKIDA provides Free online YouTube video downloader to download YouTube videos quickly in MP4, 3GP, and more. Search your video and free fast download youtube videos.

Visite Tool

Sign up for weekly update

Milkshake is almost ready. If you're interested in testing it out, then sign up below to get exclusive access.