B. Getting Started with MySQL

The following describes the procedure for installing the free version of MySQL on a computer running Windows. Note that the procedure may vary, depending on what is already installed on your computer. There are two main pieces of software to install:

Image MySQL Community Server

Image MySQL Workbench

MySQL Community Server allows you to create databases. The MySQL Workbench is a graphical interface that allows you to issue SQL commands to interact with the server and any databases you create. At the time of this writing, MySQL Community Server and MySQL Workbench are both at version 8.0.

Installing MySQL Community Server and Workbench

This procedure will install MySQL Community Server and MySQL Workbench on a Windows computer.

The steps for installing are as follows:

1. Go to dev.mysql.com/downloads.

2. Select MySQL Community Server

3. Select the appropriate version for your computer and click DOWNLOAD.

4. On the Choose a Setup Type pane, select the Developer Default option, then NEXT.

5. If desired, log into or create an Oracle account.

6. After the download completes, open the downloaded file.

7. When asked if you want this app to make changes to your device, select YES.

8. On the Check Requirements pane, click NEXT.

9. On the Installation pane, click EXECUTE. When installation of all software completes, click NEXT.

10. On the Product Configuration pane, click NEXT.

11. On the Type and Networking pane, accept all defaults and click NEXT.

12. On the Authentication Method pane, accept the defaults and click NEXT.

13. On the Accounts and Roles pane, enter a password. Make a note of the password chosen, then click NEXT.

14. On the Windows Service pane, accept all defaults and click NEXT.

15. On the Apply Configuration pane, click EXECUTE. When configuration completes, click FINISH.

16. On the Product Configuration pane, click NEXT.

17. On the MySQL Router Configuration pane, click FINISH.

18. On the Product Configuration pane, click NEXT.

19. On the Connect to Server pane, enter the previously selected root user password, then click CHECK, then NEXT.

20. On the Apply Configuration pane, click EXECUTE. When configuration completes, click FINISH.

21. On the Product Configuration pane, click NEXT.

22. On the Installation Complete pane, click FINISH.

After the above has completed, you will have MySQL Community Server and MySQL Workbench installed.

Using MySQL Workbench

When you first open MySQL Workbench after the initial install, you will need to establish a connection to your MySQL Server instance that you already installed. Select Manage Connections under the Database menu, and select TEST CONNECTION. If prompted, enter the password for root that you previously specified. After this is done, select the connection. This should open up a window that allows you to enter SQL queries

You’ll then need to create a database to work with. To do this, select the connection and click the icon under the menu bar that says CREATE A NEW SCHEMA IN THE CONNECTED SERVER. Enter a desired database name (ex: FirstDatabase), and then click APPLY. This will generate a script to create a new schema. Click APPLY to run the script. You will then see your new database under the list of schemas in the Navigator pane. You should then return to Manage Connections under the Database menu and enter the database you just created as the default schema. You can then highlight that database and create a new query to run any desired SQL against that database.

After entering a SQL statement in the Query pane, click the EXECUTE button, which looks like a lightning bolt. If you enter multiple statements in the window, you can highlight one individual statement and execute only the highlighted portion.

The results of your query will be shown under an Output or Result pane after the query is executed. If there is data to be shown, it will appear in a Result pane. Otherwise, a status message will appear under an Output pane.

Installing MySQL Community Server and Workbench

Using MySQL Workbench

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.152.251