Installation of MySQL
1. Install MySQL on Mac (x86 or ARM chips): Page 2 to Page 29
• Download data: Page 17
2. Install MySQL on Windows: Page 30 to 53
Database System Concepts - 7th Edition 1.1 ©Silberschatz, Korth and Sudarshan
Install MySQL on Mac
1. Install MySQL community server
2. Install MySQL workbench (a client interface to interact with the server)
3. Connect workbench to server
2.
Database System Concepts - 7th Edition 1.2 ©Silberschatz, Korth and Sudarshan
1.1 Click MySQL Community Server. 1.2 Look for DMG archive
Database System Concepts - 7th Edition 1.3 ©Silberschatz, Korth and Sudarshan
1.3 “No thanks, just start my download”. 1.4 Install
Database System Concepts - 7th Edition 1.4 ©Silberschatz, Korth and Sudarshan
1.5 If asked, enter the password that 1.6 Click next
you used to log into your computer
Database System Concepts - 7th Edition 1.5 ©Silberschatz, Korth and Sudarshan
1.7 choose and enter a password for root. Remember that password.
It is very important to
remember the
password your choose.
Database System Concepts - 7th Edition 1.6 ©Silberschatz, Korth and Sudarshan
1.8 Finished 1.9 You can now find it in system settings
Database System Concepts - 7th Edition 1.7 ©Silberschatz, Korth and Sudarshan
Install MySQL on Mac
1. Install MySQL community server
2. Install MySQL workbench
3. Connect workbench to server
2.
Database System Concepts - 7th Edition 1.8 ©Silberschatz, Korth and Sudarshan
2.1 Download MySQL workbench 2.2 Choose DMG Archive
Database System Concepts - 7th Edition 1.9 ©Silberschatz, Korth and Sudarshan
2.3 “No thanks, just start my download” 2.4 Drag it into Applications
Database System Concepts - 7th Edition 1.10 ©Silberschatz, Korth and Sudarshan
2.5 Open it
Database System Concepts - 7th Edition 1.11 ©Silberschatz, Korth and Sudarshan
Install MySQL on Mac
1. Install MySQL community server
2. Install MySQL workbench
3. Connect workbench to server
2.
Database System Concepts - 7th Edition 1.12 ©Silberschatz, Korth and Sudarshan
3.1 I delete the existing connection 3.2 click the plus sign besides MySQL
in order to show you how to start Connnections
from scratch
right click to open the
menu
Database System Concepts - 7th Edition 1.13 ©Silberschatz, Korth and Sudarshan
3.3 enter username and connection 3.4 enter the password you chose on page 6,
name then press OK.
Database System Concepts - 7th Edition 1.14 ©Silberschatz, Korth and Sudarshan
3.5 If you see this warning 3.6 MySQL workbench
(because the MySQL sever version
is slightly higher), press “continue
anyway”.
Database System Concepts - 7th Edition 1.15 ©Silberschatz, Korth and Sudarshan
Create the university database used in the
textbook “Database system concepts”
Database System Concepts - 7th Edition 1.16 ©Silberschatz, Korth and Sudarshan
1. go to [Link] 2. download both DDL and
SQL codes for creating small
and large relations
Database System Concepts - 7th Edition 1.17 ©Silberschatz, Korth and Sudarshan
3. start MySQL 4. click the 2nd icon on top left to
workbench that we have open an existing .sql file
installed
Database System Concepts - 7th Edition 1.18 ©Silberschatz, Korth and Sudarshan
5. Select [Link] (downloaded from [Link]) and click open
Database System Concepts - 7th Edition 1.19 ©Silberschatz, Korth and Sudarshan
6. Afer opening [Link], click the lighting bolt with cursor or light bolt
button. But this time you get an error.
Database System Concepts - 7th Edition 1.20 ©Silberschatz, Korth and Sudarshan
7. Right click, choose “copy response”, and paste it to any text editor to see the full message
Database System Concepts - 7th Edition 1.21 ©Silberschatz, Korth and Sudarshan
8. Add “create …” and “use …” and then click the lighting bolt button to
execute the whole script.
Database System Concepts - 7th Edition 1.22 ©Silberschatz, Korth and Sudarshan
9. Press the refresh button next to SCHEMAS and you can see the new tables
created. But now they are empty. So, we need to populate them.
Database System Concepts - 7th Edition 1.23 ©Silberschatz, Korth and Sudarshan
10. Open smallRelations***.sql or largeRelations***.sql to populate the tables
Database System Concepts - 7th Edition 1.24 ©Silberschatz, Korth and Sudarshan
11. Run (press the “light bolt” sign) but see an error. Follow the instructions to fix
it.
uncheck it
Database System Concepts - 7th Edition 1.25 ©Silberschatz, Korth and Sudarshan
12. press the reconnect button and lighting bolt button to exercise the whole script
Database System Concepts - 7th Edition 1.26 ©Silberschatz, Korth and Sudarshan
13. press “create new sql” button, type and run “select * from classroom;”
Database System Concepts - 7th Edition 1.27 ©Silberschatz, Korth and Sudarshan
Password
created
on page 6
14. Run
MySQL
from a
terminal
using full
address
Database System Concepts - 7th Edition 1.28 ©Silberschatz, Korth and Sudarshan
14. Run MySQL from a terminal using mysql …
Don’t know where to find mysql. So, we will
add mysql’s directory to the PATH
environment variable.
Can use any editor. The file can be .zprofile if you didn’t find a .zshrc file
execute it
PATH specifies a set of
directories, separated by
colon :, where executable
programs are located.
Database System Concepts - 7th Edition 1.29 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Database System Concepts - 7th Edition 1.30 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Database System Concepts - 7th Edition 1.31 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Database System Concepts - 7th Edition 1.32 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Press the green arrow to add
Database System Concepts - 7th Edition 1.33 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Add in both server and workbench
Database System Concepts - 7th Edition 1.34 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Database System Concepts - 7th Edition 1.35 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Database System Concepts - 7th Edition 1.36 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
choose the root password
and remember it.
Database System Concepts - 7th Edition 1.37 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Database System Concepts - 7th Edition 1.38 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Database System Concepts - 7th Edition 1.39 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Database System Concepts - 7th Edition 1.40 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
2. Enter the
password you’ve
chosen on page 37
1. Click this area
Database System Concepts - 7th Edition 1.41 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
2. press the light bolt sign to execute them
1. create and
select the
database
3. results
Database System Concepts - 7th Edition 1.42 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
1. open the [Link] file obtained from [Link]
2. then press the lighting bolt sign to execute it.
Tables are created, but so far, have no records.
Database System Concepts - 7th Edition 1.43 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
1. To populate the tables, open [Link]
obtained from [Link]
2. Then press the lighting bolt sign to execute it
3. Get an error message. Place the cursor on the message to see it.
Then follow the instructions to fix it.
Database System Concepts - 7th Edition 1.44 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Database System Concepts - 7th Edition 1.45 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
uncheck the box, then press OK
Database System Concepts - 7th Edition 1.46 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
press to “reconnect” as required by the instructions
Database System Concepts - 7th Edition 1.47 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
press lighting bolt to execute the whole script
then, records are inserted
into tables row by row
Database System Concepts - 7th Edition 1.48 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
Place cursor in the 3rd line and press “lighting bolt with
cursor” to execute the statement containing the cursor.
result
Database System Concepts - 7th Edition 1.49 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows
1. copy this address
You do not have to
do the following
unless you want to
run mysql from
command line.
2. Open adv. system settings
Database System Concepts - 7th Edition 1.50 ©Silberschatz, Korth and Sudarshan
Edit Path in System Variables
Database System Concepts - 7th Edition 1.51 ©Silberschatz, Korth and Sudarshan
Press “New”, paste the address, and Press “OK”, “OK”
Database System Concepts - 7th Edition 1.52 ©Silberschatz, Korth and Sudarshan
Install MySQL on windows login as root,
then enter your
password on
Page 37
open command prompt
Database System Concepts - 7th Edition 1.53 ©Silberschatz, Korth and Sudarshan