Sunday, August 13, 2017

Week 6: DataBase Use Linux/Fedora

INTRODUCTION
This week is to use and create a simple database in Linux. First for those who have used or have knowledge MySQL language this will be very familiar. Here will not make you an expert but will show how to ensure the program is available and create and view a simple database.


Image 1

SETTING UP
Image 2
Must first check to see if the database is loaded. On the this system using MariaDB. Mention this should any issues arise can go the following link for more information https://mariadb.org/.






In image1 (above) shows the results of the command rpm -qa | grep mariadb which ensures program exists. Next, image2 checks to make sure that the database is active using systemctl status mysqld






Image 3




 CREATING DATABASE
First need to access the database using the command mysql -u root -p image3 shows the result of the command. Notice [none] next to the mariadb this shows that you are not in an active database.



Now can create the first database. The command is the similar to what is used in MySQL. The CREATE DATABASE command and name of the database in this case JohnDB. It is important to remember to use semicolons at the end of the command lines. Example in  image4 below can see command and using the USE command to enter the newly created database. Here note that the [none] has changed to the new database.
Image 4
CREATING TABLE
In image 5 can see all the commands and entering data into the table.
Image 5

DISPLAY TABLE
In image6 can see the results of the table created in the database. Note that used SELECT * FROM command to see all data in the Employees table.
Image 6
CONCLUSION
This week installed, created a database and displayed a table from the database. Knowing the basic commands from MySQL would be very helpful in working in this system.






.

No comments:

Post a Comment