Intro to Databases on Linux

Nabil Ahsan
5 min readJan 27, 2018

--

Linux Mint. Preeetttyyyyy.

So the start of a new semester in the University of Houston means an introduction to new technologies. The classes I have this semester are

Algorithm and Data Structures

Introduction to Operating Systems

Design File and Database Systems

As I am teaching myself front-end skills (HTML/CSS/JS), the idea of databases interested more than the other classes. Granted they are more important, but we will get to that later.

We had to email our database professor all the programming languages we know because 40% of our credit is a team project and she wants enough info needed to make the team. The team will work on the project for the entire semester. Our professor kindly provided a list of resources to play around with.

No love for Linux? None?

I have a terrible habit of jumping head first into everything and here, I did just that. Skipping the tutorials, I clicked the Microsoft link to SQL Server Express page on one tab and the Server tutorial on the other. I was greeted with a beautiful page asking me to either download the .exe file or explore other options:

More editions, please.

There I scrolled down, until I came across this:

So many choices.

Because Linux Mint is based on Ubuntu, I went ahead and clicked on the Ubuntu option, which took me to the standard installation procedure for everything that is Linux.

Just the usual, isn’t it?

I followed every detail and had it set up on my machine in no time. I chose a root password, which is, arguably, the most important part in all of this. You NEED to secure your database. Then, I just typed in “Microsoft SQL Tutorial” onto YouTube and, it turns out, all the videos used SQL Server Management Studio.

Well, damn it. Linux doesn’t have that. I am not even that much of an expert on Linux to run the entire Database from the terminal. Also, I will be working with a team. The chances of them using Linux is close to 0.

I can see everyone’s laptops from the back. I know.

So I ditched it. I decided to pop into my Software Manager and type in SQL and lo and behold MySQL Workbench.

Thank you, Oracle. Screw you Microsoft.

So I went back to the previously mentioned resources page and looked at the MySQL tutorial page. Fair enough, it took me to a well-structured tutorial and even provided a sample database for me to start playing with. Now we are getting somewhere.

But alas, it was once again geared toward Windows. However, I found this little nifty page from a bit of googling that details how to set up a MySQL server. Turns out it’s pretty similar to what I did before. I had to put in a root password, which will later be required in MySQL Workbench.

With everything set up, I downloaded the sample database. This will be a .sql file. Then I went into MySQL Workbench and clicked the little plus symbol beside “MySQL Connections” which opened up the “Setup New Connection” window.

sampleDB is what I named it. You can name it anything you want.

I made mine sampleDB, as you can see, and kept the Default Schema empty. I was then prompted to enter the password I entered when I was setting up the MySQL server. You will be greeted with this:

So much emptiness…

CTRL+SHIFT+O will open up a window that will allow you load the sample database you downloaded.

And here we go:

But what does it all mean?!?!?!?!?!

Click that little thunderbolt icon that is directly below your mysqlsampledatabase tab. This will then show up under your schema on the left hand side as classicmodels . Go back to your Query Tab and type in USE classicmodels and SELECT * FROM customers on the next line. Then click the thunderbolt icon again. This runs the script you just entered and displays the data in this format:

That is pretty much the extent of my work with database. I hope to write a follow up to this once I get started on my team project. I am currently watching Derek Banas’ video on MySQL, where he magically aims to explain almost all aspects of MySQL. Because he is amazing. He also has videos on Python, C++ (Which I really need), Java, Javascript and so on.

I should apologize for the redundancies. My mind is always racing and shooting in different directions. That is exactly what I wanted to highlight in this blog. I really hope to be more on point with my message in future blogs. You can clap if you loved and comment if you did/didn’t like what I had to say. Constructive criticism is always welcome. It’s what makes computer science so great.

You can reach out to me on Instagram, as I always enjoy getting followers, being a photographer and all (shameless promotion). I also have my Github page and my LinkedIn page, for all you professional people out there.

--

--