MySQL + SQL · Lesson 32

MySQL Command Line Basics

Using the MySQL CLI

The MySQL command-line client lets you run SQL directly in the terminal.

Connecting

mysql -u root -p
# enter your password when asked

Useful CLI Commands

CommandDoes
SHOW DATABASES;list databases
USE school;select a database
SHOW TABLES;list tables
DESC students;show table structure
\q or EXIT;quit

Summary

  • Connect with mysql -u root -p.
  • USE selects a DB; SHOW/DESC explore it; EXIT quits.
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

WhatsApp