MySQL is a huge part of the data world and often people are scared to get started, because they don't know how, where or what to start with.
Before start the tutorial you will need to install MySQL Server on your machine along with MySQL Client for writing SQL.
I'll write out the steps for Ubuntu Users, if your not using Ubuntu you will need to google the setup steps.
No start of a project is complete without an apt update :)
sudo apt update && sudo apt upgrade
This ensures your repo's are all up to date.
On Ubuntu this is dead easy, no crazy warren of pages to find the right download.
sudo apt install mysql-server
Accept any of the prompts about disk space and continue.
Next you need to run the
y for all of the questions you get until it asks what level of security you want, then type
0 for the lowest settings of security.
Note: This really doesn't matter as its a local test DB, if it was live we would need to use more secure passwords.
And thats it.... MySQL is installed.
Now onto the MySQL Client
DbeaverCE is a free open source Database management tool. I used to use a tool called DB Visualiser but this was a premium tool (over £100) and to be honest didn't give enough of a benefit over a free version so now i use either Jetbrains DataGrip or Dbeaver.
to install simple type the following in your terminal.
sudo snap install dbeaver-ce
Done! Its now installed and you can open it from the applications menu!
Now onto Sample Database.
MySQL link to a few Example DB's but i quite like the Employee one for getting started with.
To install simply open up a terminal and cd to a location you're happy with like Documents. When there type the following into the terminal:
git clone https://github.com/datacharmer/test_db.git
Now cd into this directory...
Once in this directory type the following in the terminal:
mysql < employees.sql
You should then see the below.
That's going to wrap it up for this tutorial today, il be adding more and more this MySQL series over the next days, weeks and months. Next tutorial will be a basic SELECT statement leading onto a simple JOIN.