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
| Command | Does |
|---|---|
| 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.
💻 Live Code Editor
Is page ki language (MYSQL) mein code likhein aur turant chalाएं — yahीं, bina kuch install kiye.Powered by OneCompiler. Agar editor na khule to yahान naye tab mein kholein.
💻 Live Code Editor
Is page ke program yahan ready hain — chalाएं, badlें aur seekhें. Bina kuch install kiye.
Powered by OneCompiler. Editor mein code apne aap aa jata hai — Run dabaakर output dekhें.
Agar load na ho to naye tab mein kholें.