DEV Community

Cover image for DBMS with mysql. Without using GUI...
Tilak Khatri
Tilak Khatri

Posted on

DBMS with mysql. Without using GUI...

Sql with terminal

How to do like above. Is it difficult to do? How to start playing with terminal as *hacker *:) just kidding.

I am so bored when creating database and it's different table with Graphical User Interface (GUI). That's why I will help those who want to dirty their hands with command line.

Here it goes with answer of How to start?

  1. Configure all environments (xampp) / any mysql

  2. type mysql in cmd

  3. type mysql -u user_name -p password

  4. after successfull

mysql>
Enter fullscreen mode Exit fullscreen mode
  1. To list database type the following command
mysql>show databases;
Enter fullscreen mode Exit fullscreen mode

output:

+--------------------+
| Database           |
+--------------------+
| coronadb           |
| ecomm              |
| ecommerce          |
| information        |
| information_schema |
| mysql              |
| performance_schema |
| phpmyadmin         |
| test               |
| test1              |
| testdatabase       |
| user_login         |
+--------------------+
12 rows in set (0.001 sec)
Enter fullscreen mode Exit fullscreen mode
  1. To use these database and to list available tables type the following two commands:
mysql>use user_login;
Enter fullscreen mode Exit fullscreen mode
  1. Now list tables:
mysql[database_name]>show tables;
Enter fullscreen mode Exit fullscreen mode

output

+---------------------------+
| Tables_in_mysql           |
+---------------------------+
| columns_priv              |
| db                        |
| func                      |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| proc                      |
| procs_priv                |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+
17 rows in set (0.00 sec)
Enter fullscreen mode Exit fullscreen mode

These are command line sql for starting in command line instead of GUI.

Read sql docs and start future operation like insert,delete,filter,etc.

I will continue and help you guys to explore more on this topic.
Thanks for reading.
Recommend me any suggestion or how to improve. Or any topic?
Happy hacking.
Sign out for today.

Top comments (0)