Installation & Command Line Setup
To use MySQL, you need to install the MySQL Server and the command-line client utility.
1 Running MySQL Commands
Shell — Terminal Access
# Login to local database server
mysql -u root -p
# List all existing databases
SHOW DATABASES;
# Create a new database
CREATE DATABASE library_db;
# Select the database to write commands
USE library_db;
# Confirm active database selection
SELECT DATABASE();
2 Code Challenge
Challenge: Install MySQL Server locally, connect via terminal using your root user credentials, create a database named
ecommerce_db, and confirm its creation by running SHOW DATABASES;.