Lab 3 Create Database
Lab 3 Create Database
There are TWO ways to create your database. You can use the first way (using PhpMyAdmin) or second way (using command line).
A. Using PhPMyAdmin
1. Create a new inventory_db database. Then, run the following SQL queries to create new tables with sample data.
1 >mysql -u root -p
2 Enter password: ********
Type the password for the root user and press Enter.
2. Next, to display the existing database in the server to make sure that you are not creating a new database that already exists, you use the SHOW
DATABASES command as follows:
3. Then, issue the CREATE DATABASE command with the database e.g., inventory_db and press Enter:
4. Finally, to access the newly created database, you use the USE database command as follows:
1 mysql> USE inventory_db ;
2 Database changed
5. Now, you can start creating tables and other databases objects within the inventory_db database.