How To Use Mysql / MariaDB From Console?


Mysql is one of the most popular databases in IT world. It is open source and have rich features were paid databases provides. MariaDB is fork of the MySQL and very similar to it. We have already looked how to login and do simple steps in this post

Getting Help

We can list mysql tool help options like below.

Connect to MySQL/MariaDB

We can connect to the database cli tool named mysql by providing username and password.

LEARN MORE  Mysql Database Import Tutorial with Examples

Show MySQL/MariaDB Databases

There is default databases like information_schema,mysql,… and user added databases. We can list them with show command.

Select Database To Use Query

To query a database by default we should select database

Show Tables

show command can be used to show tables too;

Create Table

We need to create a table we will provide table name and field names with their types. We will create a table named Persons with fields PersoneID type of integer, …

LEARN MORE  What Is MySQL Default Port Number?

Deleting/Dropping Table

We will delete table completely not just the row. Drop Table is the command with the table name.

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)