For the subsequent SQL lessonseries that we are going to cover, you may want to install MySQL tofollow along with the instructor. MySQL is an open-source software; this means the softwareis free to most end-users. MySQL does offer a commercial licensefor more advanced database requirements.
First, check to see if yourcomputer is compatible to run MySQL. To do this, review this web page that will direct you to the MySQL forumwith information about compatibility. At RealPars, we love helping you learn so if you enjoy this video asmuch as we enjoyed making it, Click the like button. subscribe and click the bell and you’ll receive notificationsof new RealPars videos. so you’ll never miss another one! The MySQL has a very easy to use installer to help the user download and install all the MySQL options.
So by using this URL, go to this web page. There are two options,choosing the right file. If you have an online connectionwhile running the MySQL Installer, choose the“mysql-installer-web-community” file. If you do NOT have an online connectionwhile running the MySQL Installer, choose the“mysql-installer-community” file. This is a larger file and containsmost of the options required. When the file downloads, it will benamed: “mysql-installer-community”.
After the download, double click on the “MySQL installercommunity” file to begin the process. When the “msi” file has completedinstalling the MySQL installer program, the following window will appear. As you can see, I have already installedthe options, listed in this window. By installing one product, I will show you how to install the requiredoptions you may need for your project. A new user will left mouse clickand select the “Add” button to install the same options.
This window will display allof the uninstalled products. I am going to select theproduct which I want to install, in the “Available Products” pane. I use the arrow button to move the product to the“Products and Features to be installed” pane. I left mouse click and select “Next”button to start the install process. After selecting the required product and left mouse clicking the “Next” button, the following window will appear, displayingthe option which is ready to install.
I left mouse click andselect the “Execute” button. This will begin the install process. If you have any questions, this MySQL URL for installationdocumentation will help. You can find this link inthe description as well. After a successful install,left-click the “Windows” button. I then explore through the programsto find the “MY SQL” folder. Now let’s startup,“MySQL Workbench 8.0 CE”. MySQL Workbench is a graphical tool forworking with MySQL servers and databases. When the “Workbench” opens,the following user interface will display. I Left-click and select the “MySQLConnections, Local instance MySQL80” button.
You may need to log in using the passwordcreated during the install process. MySQL will now display theuser interface environment. We are now going to open and run ascript that has predefined our database. This is advancedscripting, but don’t worry, the next few steps are easy to follow. Much of the scripting in this schemawill be explained in additional lessons. Start by selecting the “File” menu button and scroll down to “Open SQL Script”. In my system,this folder is containing the script.
I will open the script called“realparssampledatabasev2.sql”. You can find the download linkfor this file in the description. The script is loaded intothe new schemas window. Now let’s run the script tocreate the RealPars database. Select and left mouseclick the lightning button. After selecting and running the script, the tables and relationships are created. Then data records willbe added for us to sample using a few queries and available tofollow along with the lessons available. The following window is locatedat the bottom of the screen and informs us of success andfailures while running the script.
Green checks are good,Red X’s are not good. I refresh the “Navigator” pane byclicking on the “Swirling Arrows” button to display the newly created“realpars model” database. After the refresh,the database will appear. Let’s run a quick query.Left-click the “Tables” triangle. This will expand the “Tables” folder. Now Right-click over the “students” table. Left-click the “Select Rows, Limit 100”. Doing this will create a new query toselect the top 100 rows in the database.
The new query is createdand runs automatically. The query lists all of the top 100 records. This data can now be exported toMicrosoft Excel by left-clicking and selecting the “Export recordsetto an external file” button. Select the file format you prefer. For Microsoft Excel,choose “Excel Spreadsheet” file type. I name this file “Students_top100”. Then I press the “Save button”. I browse to the folder whereI exported the data record. I then open the “Excel Spreadsheet”file by double-clicking on it.
This concludes the video, “How to installMySQL and import a sample database”. Please stay tuned for future SQLlessons, soon to be released. These lessons will provide basic andin-depth use of the SQL commands using MySQL and additional lessons on how touse this language in automation for analytical reporting,troubleshooting, and process development.
If you would like to get additionaltraining on a similar subject please let us know in the comment section. Check back with us soon for more automation control topics. Want to learn PLC programmingin an easy to understand format and take your career to the next level? Head on over toour site.