MySQL- Helpline (commands)

If you are on Linux or using the Windows MySQL shell, you can follow the commands below:

If you are completely brand new to SQL, I highly recommend checking our free SQL tutorial, downloading a sample database and learning a little about SQL. (click here)

Login to MySQL Shell

mysql -u root #Windows, no password

sudo mysql -u root #Linux, no password

sudo mysql -u root -p #If you have a password set
Password: [password-here]

Display ALL Databases

mysql> SHOW DATABASES;

+--------------------+
| Database           |
+--------------------+
| information_schema | #Default
| mysql              | #Default
| performance_schema | #Default
| sys                | #Default
| webapp_01          | #Created Database
+--------------------+
5 rows in set (0.00 sec)

Create Database

USE / SELECT Database

If you want to add any changes or send queries to your database, we have to select it, USE [dbname]`

Last updated