0% found this document useful (0 votes)
3 views

AppendixA

This appendix provides instructions for setting up Windows to use MySQL Community Server and MySQL Workbench for the book. It includes guidance on downloading, installing, and configuring the software, as well as creating and restoring the necessary databases for hands-on practice. Users are advised to use MySQL 8.0 for compatibility with the book's examples, while also being informed about the new versioning model introduced by Oracle in July 2023.

Uploaded by

kitso
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

AppendixA

This appendix provides instructions for setting up Windows to use MySQL Community Server and MySQL Workbench for the book. It includes guidance on downloading, installing, and configuring the software, as well as creating and restoring the necessary databases for hands-on practice. Users are advised to use MySQL 8.0 for compatibility with the book's examples, while also being informed about the new versioning model introduced by Oracle in July 2023.

Uploaded by

kitso
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Appendix A

How to set up Windows


for this book
Before you begin reading this book, we recommend that you install MySQL
Community Server and MySQL Workbench. Both of these software products
are available for free from the MySQL website, and you can install them on
your computer as described in this appendix.
After you install these products, we recommend that you download
the files for this book that are available from the Murach website
(www.murach.com). Then, we recommend that you run the SQL script that
creates the databases that are used throughout this book.
Once you create these databases, you’re ready to gain valuable hands-on
experience by running the SQL scripts for the examples presented in this
book. In addition, you can get more practice by doing the exercises that are at
the end of each chapter, starting with chapter 2.

How to install MySQL Community Server..................................................592


How to start and stop the MySQL sever.......................................................592
How to install MySQL Workbench..............................................................594
How to download the files for this book.......................................................596
How to create the databases for this book....................................................598
How to restore the databases........................................................................598
592 Appendix A How to set up Windows for this book

How to install MySQL Community Server


MySQL Community Server is a database server that’s free and easy to use.
Since it’s designed to run on most modern computers, it’s ideal for developers
who want to install it on their computer so they can learn how to work with a
MySQL database. That’s why this book assumes that you have installed the
Community Server on your computer.
In July 2023, Oracle announced a new versioning model for MySQL that
provides two different release tracks. The releases that contain new features and
improvements will be known as Innovation versions, and the releases that will
only be updated with bug fixes after the initial release will be known as Long
Term Support (LTS) versions. Oracle also released the first Innovation version,
MySQL 8.1 Innovation. In addition, Oracle announced that MySQL 8.0.34 and
later will only be updated with bug fixes, not with new features or improve-
ments. As a result, MySQL 8.0 is now essentially an LTS version.
So, which version should you install? If you want to make sure the MySQL
server works exactly as described in this book, we recommend installing
MySQL 8.0. That’s because all of the SQL statements presented in this book
have been tested against MySQL 8.0.
On the other hand, if you want the latest features and improvements as they
become available, you should install the newest Innovation version of MySQL.
Or, if you only want access to the features included in an LTS version, you
should install the newest LTS version. Oracle plans to release the first LTS
version in 2024. Since MySQL is backwards compatible, the SQL statements
presented in this book should also work with these releases of MySQL. For
example, we tested all of the SQL statements in this book against MySQL 8.1,
and they all worked correctly.
Once you decide on a version of the MySQL server, you can install it as
described in figure A-1. This procedure varies depending on whether you’re
installing MySQL 8.0 or a later version, but regardless of the version, it installs
only the MySQL server using the typical configuration options. As part of this
procedure, you need to specify a password for the root user. When you do, make
sure to remember the password that you enter.

How to start and stop the MySQL sever


To make sure the MySQL server has been installed correctly, you can start
the Services app and check whether the service for the MySQL server is running.
By default, this service has a name that begins with MySQL and ends with the
first two digits of the version number. For instance, the service for MySQL 8.0 is
named MySQL80.
By default, the MySQL service starts automatically when you start your
computer. However, there are times when you may want to stop this service. For
example, you can stop this service if you aren’t going to be using it and you want
to free the resources on your computer. To do that, you can use the procedure
Appendix A How to set up Windows for this book 593

The MySQL Community Server downloads page


http://dev.mysql.com/downloads/mysql/

How to install MySQL Community Server


1. Go to the MySQL Community Server downloads page. If necessary, you can find
this page by searching the internet for “MySQL community server download”.
2. Select the version of MySQL that you want to install and select Windows as the
operating system. If you select version 8.0, click the MySQL Installer link to go to
that page.
3. Download the installer (MSI) file by clicking its Download button. For MySQL 8.0,
you download the MSI file for the MySQL Installer for all MySQL products. For
MySQL 8.1 and later, you download a MSI file that’s only for the MySQL server.
4. Find the downloaded MSI file and double-click it. This should start the installer.
5. Respond to the resulting dialogs to install MySQL and configure it. You can accept
most of the default options.
•• For the setup type, if you’re installing MySQL 8.0, leave the setup type at its
default setting of Server Only. If you’re installing 8.1 or later, select Typical.
•• Make sure to enter a password for the root user, and make sure to remember the
password that you enter.

How to start and stop the MySQL server


1. Click the Windows Start button, type “services”, and select the Services app.
2. Scroll down to view the MySQL service. By default, the service for MySQL 8.0 is
named MySQL80, the service for MySQL 8.1 is named MySQL81, and so on.
3. Right-click the MySQL service and select Start or Stop. Or, if you want to control
whether MySQL starts automatically when you start your computer, select
Properties.

Description
•• In July 2023, Oracle announced a new versioning model for MySQL that provides
two different release tracks. The releases that contain new features and improvements
will be known as Innovation versions, and the releases that will only be updated with
bug fixes after the initial release will be known as Long Term Support (LTS) versions.
•• Since July 2023, Oracle is only updating MySQL 8.0 with bug fixes, not new
features or improvements. As a result, MySQL 8.0 is now essentially an LTS version.
•• If you want to make sure that the MySQL server works exactly as described in this
book, you should use the 8.0 version.
•• If you want access to the latest features as they become available, you should use
an Innovation version. The first Innovation version is 8.1.
•• If you only want access to the features included in an LTS version, you can use that
version. The first LTS version will become available in 2024.
•• You can use the Services app to start and stop the MySQL service and to control
whether the MySQL server starts automatically when you start your computer.
Figure A-1 How to install MySQL Community Server
594 Appendix A How to set up Windows for this book

shown in figure A-1. Then, when you’re ready to start the service again, you can
use this procedure to do that too.

How to install MySQL Workbench


MySQL Workbench is a free program that makes it easy to work with
MySQL databases. To install MySQL Workbench, you can use the procedure
shown in figure A-2. When you download the installer file, make sure it is the
installer file for MySQL Workbench only, not the installer file for all MySQL
products.
If you install a newer version of MySQL server such as 8.1 Innovation, you
may need to install an older version of Workbench such as 8.0. That’s because
a version of Workbench that corresponds to your version of the MySQL server
may not yet be available. In that case, you can install the older version of
Workbench and use it until a new version becomes available.
All of the skills for working with MySQL Workbench presented in this
book were tested against version 8.0. As a result, if you’re using this version of
MySQL Workbench, these skills should work exactly as described. If you’re
using a later version of MySQL Workbench, these skills may not work exactly as
described, but they should work similarly.
Appendix A How to set up Windows for this book 595

The MySQL Workbench downloads page


http://dev.mysql.com/downloads/workbench/

How to install MySQL Workbench


1. Go to the MySQL Workbench downloads page. If necessary, you can find this page
by searching the internet for “MySQL Workbench community download”.
2. Select Windows as the operating system.
3. Click the Download button to download the installer (MSI) file for the latest
version of MySQL Workbench. This file should be named something like mysql-
workbench-community-8.x.xx-winx64.msi. Make sure you download this installer
file, not the MySQL Installer for all MySQL products.
4. Find the installer file and double-click it to start the installer.
5. Respond to the resulting dialog boxes. You can accept all defaults.

Notes
•• If you install a newer version of MySQL server such as 8.1 Innovation, you may
need to install an older version of Workbench such as 8.0. That’s because there may
not yet be a newer version of Workbench available.
•• To make it easy to start MySQL Workbench, you can pin it to the taskbar.

Figure A-2 How to install MySQL Workbench


596 Appendix A How to set up Windows for this book

How to download the files for this book


Figure A-3 shows how to download the files for this book. This download
includes a SQL script that you can use to create the databases that are used
throughout this book. It includes SQL scripts for all of the examples in this
book. And it includes SQL scripts for the solutions to the exercises that are at the
end of each chapter.
The files for this book are in a zip file that you can download from
www.murach.com. When you download this file, it contains a directory named
mysql that stores the SQL script files for this book. Within this directory, you
can find the subdirectories that contain the files shown in this figure.
After double-clicking on the zip file to view the mysql directory, we recom-
mend moving this directory into a directory named murach that you can create
directly on your hard disk. That way, the directories and files on your system
will match the directories and files shown in this book.
Appendix A How to set up Windows for this book 597

The recommended directory for the files


C:\murach\mysql

The files for this book


Directory Contains
db_setup The SQL script that creates the three databases for this book.
book_scripts The SQL scripts for all of the examples presented in this book.
ex_solutions The SQL scripts for the solutions to the exercises at the end of each chapter.
diagrams The MySQL Workbench file for the diagram that’s presented in chapter 10.

The databases for this book


Database Description
ap The AP (Accounts Payable) database. This database is used by most
examples in this book.
om The OM (Order Management) database. This database is used by a few
examples in this book.
ex The EX (Examples) database. This database contains several tables that are
used for short examples.

How to download the files


1. Go to www.murach.com.
2. Find the page for Murach’s MySQL (4th Edition).
3. Scroll down to the “FREE downloads” tab and click it.
4. Click the Download Now button for the zip file to download a setup file named
msq4_allfiles.zip.
5. Find the downloaded zip file and double-click it. This should display a directory
named mysql.
6. Use File Explorer to create a directory named murach in the root directory of your
hard disk.
7. Use File Explorer to move the mysql directory into the murach directory.

Description
•• All of the files described in this book are contained in a zip file that can be
downloaded from www.murach.com.

Figure A-3 How to download the files for this book


598 Appendix A How to set up Windows for this book

How to create the databases for this book


Before you can run the SQL statements presented in this book, you need to
create the three databases used by this book. To do that, you can use MySQL
Workbench to run the SQL script that’s stored in the create_databases.sql file as
described in figure A-4.
To determine if the SQL script ran successfully, you can review the results
in the Output window. In this figure, for example, the Output window shows a
series of statements that have executed successfully. In addition, the Schemas tab
of the Navigator window shows that the three databases have been created. The
other database, named sys, is a database that comes with MySQL.
If the script encounters problems, MySQL Workbench displays one or more
errors in the Output window. Then, you can read these errors to figure out why
the script isn’t executing correctly.
Before you can run the create_databases.sql script, the database server must
be running. By default, the database server starts automatically when you start
your computer, so this usually isn’t a problem. However, if it isn’t running on
your system, you can start it as described in figure A-1.

How to restore the databases


As you work with the code that’s presented in this book, you may make
changes to the databases that you don’t intend to make. In that case, you may
want to restore the databases to their original state so your results match the
results shown in this book. To do that, you can run the create_databases.sql file
again. This deletes the three databases described in this appendix and recreates
them.
Appendix A How to set up Windows for this book 599

The directory that contains the create_databases.sql file


C:\murach\mysql\db_setup

MySQL Workbench after executing the create_databases.sql file

Execute Script
button

Open SQL Script


File button

How to create the databases


1. Start MySQL Workbench.
2. Click on the stored connection named “Local instance MySQL” and enter the
password for the root user if prompted. This is the password that you created when
installing the MySQL server in figure A-1. This connects you as the root user to the
local instance of MySQL.
3. If you get a warning that MySQL Workbench is incompatible with the server
version and that some features may not work properly, don’t be alarmed. You can
click Continue Anyway and the features described in this book should still work.
4. Open the create_databases.sql file by clicking the Open SQL Script File button.
Then, use the resulting dialog box to locate and open the file. When you do,
MySQL Workbench displays this script in a SQL Editor tab.
5. Execute the script by clicking the Execute Script button. When you do, the Output
window displays messages that indicate whether the script executed successfully.

How to restore the databases


•• Run the create_databases.sql script again to delete the databases and recreate them.

Figure A-4 How to create and restore the databases for this book

You might also like