MySQL Installation and Practice
MySQL Installation and Practice
actice
1
Contents
• Download and install MySQL
• MySQL installer
• MySQL Server
• MySQL Workbench
2
Download MySQL installer
• MySQL installer Address: https://dev.mysql.com/downloads/installer/
Others: https://dev.mysql.com/downloads/ 3
Only MySQL Server and
MySQL Workbench
4
error
• Error message : one more product requirements have not been sa
tisified …
• Reason: your computer does not have some plug-in.
• Solution: select No button of the prompt, then click Execute button, r
ather than Next button.
After solving the error, click Next button keeping the default setting.
5
Keep the default setting
6
Give a password
For the class practice, a simple password is okay.
7
Keep the default setting
8
MySQL Workbench starts after clickin
g Finish
9
Connect MySQL server
10
Import SQL DDL
DDL file is available here: https://github.com/liangyihuai/sql-sample-data. The file name is ddl.sql
11
Import sample data
Sample data file is available here: https://github.com/liangyihuai/sql-sample-data. The file name is smallRelationsInsertFile.sq
12
Error while import sample data
Solution:
step1:uncheck “Safe Updates(rejects UPDATEs and DELETEs with no restrictions)”
Step2: restart workbench
13
Show imported data
14
Database Design
15
Sample Data ( A part of )
16
Perform SQL query
• tag1: execute all SQLs.
• tag2: execute only one SQL in where the mouse cursor put.
show databases;
-- To find all instructors in Comp. Sci. dept with salary > 80000 select name
from instructor where dept_name = 'Comp. Sci.' and salary > 80000;