Languages
[Edit]
EN

MySQL / cmd - most useful commands

0 points
Created by:
Abul-Emery
517

In this article, we would like to show you the most useful cmd commands for MySQL.

1. Login user

Quick solution:

mysql -u root -p

Full command: 

mysql --user=<username> --password=<password>

Note:

If you didn't specify password during mysql installation use the following command:

mysql --user=root --password=

2. Show databases

Quick solution:

SHOW databases;

3. Create / Drop database

Quick solution:

CREATE DATABASE database_name;
DROP DATABASE database_name;

4. Use / switch database

Quick solution:

USE database_name;

Note:

To switch database simply use the above command with a different database_name.

5. Show tables

Quick solution:

SHOW tables;

6. Create / Drop table 

Quick solution:

CREATE TABLE table_name;
DROP TABLE table_name;

Alternative titles

  1. MySQL / cmd - most common commands
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

MySQL / cmd

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join