MySQL - CREATE Database Command in Terminal - Console [ SHOW SELECT DROP USE ]

preview_player
Показать описание
In this tutorial, the self-taught developer explains how to create, drop, select, show, and use databases on a MySQL server using on the terminal.

It probably one of the simplest commands to know in the MySQL syntax, and also one of the least used commands.

I am how often is it that you decide to create a database.

So you can create a database, by simply giving the command:

CREATE DATABASE database_name;

Then to use the database:

USE database_name;

To delete the database, you should issue the following command:

DROP DATABASE database_name;

By aware, that this deletes all tables with it, therefore if you have data in some tables which you need then, make certain to back up this data prior to dropping the database,

You can always, tell which database you are currently using, by issuing the command:

SELECT DATABASE();

This will list out the one single database which you have selected or are using.

If you haven't selected a database to use, then it will display NULL

You can get a list of all databases on this one server by issuing the command:

SHOW DATABASES;

This will then list out all databases on the server.

#SelfTaughtDeveloper #DavidThorn
Рекомендации по теме
Комментарии
Автор

Thanks for this. You can read this stuff, but seeing someone actually do it is very helpful.

bashbrannigan
Автор

Thank God, a video that works...great job thorn web design...I was jumping through so many hoops till I finally got here...!!!

summerlamb
Автор

hi, i have a problem that need a solutions...i already create new database in linux to make my website on live server which I'm using WordPress platform. right now I'm facing can't select database. the username n password are working fine. how can i put my database from localhost which i already export from phpmyadmin to the Linux new database which i create earlier...if u guys have any link that i can refer to..pls share it knowledge... thanks in advance.👍

thebiskut
Автор

After installing when i try to create database get this error;
create database test;
ERROR 3680 (HY000): Failed to create schema directory 'test' (errno: 2 - No such file or directory)

wasimshaikh-nspu
Автор

mysql> pwd
-> clear
-> exit
-> `
`> show database
`> exit
`> \h
`> \c
`>
`>
`>
`>
`> exit
`> help
`>
not coming to base. Please help

mansijswarnkar
Автор

i want to learn how to create table in mysql using terminal in ubuntu & inserting data into table & more....

shahalam
Автор

when i do something wrong i get a "->" instead of "mysql>"

tim.bogdanov