Lab7 MySQL安装以及简单数据库操作 实验目的 1)学习在 windows环境中安装 My Sql数据库 2)根据需求建立满足三个范式的数据库表 3)学习 INSERT, DELETE, UPDATE SELECT等几中常用的SQL命令及用法 实验任务 安装 MySQL数据库,并且按照需求建立数据库表,使用SQL语句进行表 内容的增、删、修改和查询 实验环境 操作系统: Windows xp或以上 ●数据库: MySQL Community Server5.0或以上 实验检查 将所有sq1语句导出到txt文件并且上传到10.132.141.33用户名:学号密 码java 实验步骤
Lab 7 MySQL安装以及简单数据库操作 实验目的 1)学习在 windows 环境中安装 MySql 数据库 2)根据需求建立满足三个范式的数据库表 3)学习INSERT,DELETE,UPDATE,SELECT等几中常用的SQL命令及用法 实验任务 安装 MySQL 数据库,并且按照需求建立数据库表,使用 SQL 语句进行表 内容的增、删、修改 和查询 实验环境 z 操作系统:Windows xp 或以上 z 数据库:MySQL Community Server5.0 或以上 实验检查 将所有 sql 语句导出到 txt 文件并且上传到 10.132.141.33 用户名:学号 密 码 java 实验步骤
1试验工具的安装 1) MySQL的安装及配置,从ftp:/ classes/07/072Web应用基础 Il/ software上下载相应的安装文件,按照如下步骤安装 MySQL数据库 2)点击NEXT按钮 I MySQL Server 5.0-Setup Wizard Welcome to the Setup Wizard for MySQL Server 5.0 The Setup Wizard will install MySQL Server 5.0 release 5.0.51a on your computer. To continue, cick Next. WARNING: This program is protected by copyright law. MuSG 匚N=x>]_cc 3)选择安装类型为“ Typical”,点击“Next”按钮
1 试验工具的安装 1) MySQL 的安装及配置,从 ftp:/classes/07/072 Web 应 用 基 础 II//software 上下载相应的安装文件,按照如下步骤安装 MySQL 数据库 2)点击 NEXT 按钮 3) 选择安装类型为“Typical”,点击“Next”按钮
iu MySQL Server 5.0-Setup Wizard Setup Type Choose the setup type that best suits your needs Please select a setup type Common program features will be installed. Recommended for C Complete All program features will be installed. Requires the most disk Custom Choose which program features you want installed and where they vill be installed. Recommended for advanced users <Back Cancel 4)点击“ Instal”按钮进行安装 Ii MySQL Server 5.0-Setup wizard Ready to Install the Program The wizard is ready to begin installation. If you want to review or change any of your installation settings, dick Back. Click Cancel to exit the wizard Current settings: Setup Type Ty Destination Folder C: Program Files MysQL MySQL Server 5.0\ < Back Cancel
4) 点击“Install”按钮进行安装
5)点击几次“Nex”按钮后,到类似下图的步骤,选中“ Configure the MySQL Server now”,然后点击“ Finish”,按钮进行 MySQL的配置 ie MySQL Server 5.0-Setup Wizard Wizard Completed Setup has finished installing MysQL Server 5.0. Click Finish to v Configure the MySQL Serve Use this option to generate an optimized MySQL config file, setup a windows service running on a dedicated port and to set the password for the root account. ySQ 6)选择“ Detailed Configuration”,点击“Next”按钮
5) 点击几次“Next”按钮后,到类似下图的步骤,选中“Configure the MySQL Server now”,然后点击“Finish”,按钮进行 MySQL 的配置 6) 选择“Detailed Configuration”,点击“Next”按钮
MySQL Server Instance Configuration Wizard My SQL Server Instance Configuration Configure the MysQL Server 5.0 server instance. Please select a configuration type a Detailed Configuration C Standard Configuration Use this only on machines that do not already have a MySQL server installation. This will use a general purpose configuration for the server that can be tuned manually cace 7)由于我们安装 MySQL是为了做实验和项目,所以选择“ Developer Machine”,点击“Next”按钮 MYSQL Server Instance Configuration Wizard MySQL Server Instance Configuration Configure the MySQL Server 5.0 server instance Please select a server type. This will influence memory, disk and CPU usage C Developer Machine This is a development machine, and many other applications will be un on it. MySQL Server should only use a minimal amount of emory C Server Machine Several server applications will be running on this machine. Choose this option for web/application servers. MySQL will have medium C Dedicated My SQL Server Machine This machine is dedicated to run the MySQL Database Server. No other servers, such as a web or mail server, will be run, MySQL will utilize up to all available memory <Bs□Nx
7) 由于我们安装 MySQL 是为了做实验和项目,所以选择“Developer Machine”,点击“Next”按钮
8)由于我们安装 MySQL没有特殊的要求,所以选择“ Multifunction Database”,点击“Next”按钮 YSQL Server Instance Configuration Wizard MySQL Server Instance Configuration Configure the MySQL Server 5.0 server instance Please select the database usage C Multifunctional Database General purpose databases. This will optimize the server for the use of the fast transactional InnoDB storage engine and the high speed MyISAM storage engine. C Transactional Database Only Optimized for application servers and transactional web applications oo MhisswlM make Innon s the main storage engine Note that the C Non-Transactional Database Only uited for simple web applications, monitoring or logging applications as well as analysis programs. Only the non-transactional MyISAM torage engine will be activated Back Next Cancel 9)选择数据库文件的存放文件夹位置,这个可以根据需要自行设定。设定后点 击“Next”按钮
8) 由于我们安装 MySQL 没有特殊的要求,所以选择“Multifunction Database”,点击“Next”按钮 9) 选择数据库文件的存放文件夹位置,这个可以根据需要自行设定。设定后点 击“Next”按钮
MYSQL Server Instance Configuration Wizard MySQL Server Instance Configura Configure the MySQL Server 5.0 server instance. Please select the drive for the InnoDB datafile, if you do not want to use the default settings. InnoDB Tablespace Settings Please choose the drive and directory where the InnoDB tablespace should be placed C: MSQL Datafilesl Drive Info C File System: NTFS 14.6 GB Diskspace Used [ 4.9 GB Free Diskspace Back Next> Cancel 10)下面是并发设置,按照默认设置选择“ Decision Support(Dss)/OLAP” 即可,点击“Next按钮 MySQL Server Instance Configuration Wizard ly SQL Server Instance Configuration Configure the MySQL Server 5.0 server instance. Please set the approximate number of concurrent connections to the server G Decision Support(DSS)/OLAP Select this option for database applications that will not require a high number of concurrent connections. A number of 20 connections will be assumed C Online Transaction Processing(OLTP) Choose this option for highly concurrent applications that may have at any one time up to 500 active connections such as heavily loaded web servers C Manual Setting Please enter the approximate number of concurrent connections. Concurrent connections 15 Back Next Cancel
10) 下面是并发设置,按照默认设置选择“Decision Support(DSS)/OLAP” 即可,点击“Next 按钮
11)下一步进行网络设置,选中“ Enable TCP/ IP Networking”,端口号选用 默认的3306即可,选中“ Add firewall exception for this port”复选框;选 中“ Enable strict mode”点击“Next”按钮 MySQL Server Instance Configuration Wizard MySQL Server Instance Configuration Configure the MySQL Server 5.0 server instance Please set the networking options V Enable TCP/IP Networking Enable this to allow TCP /IP connections. When disabled, only local connections through named pipes are allowed Port Number: 3306 v Add firewall exception for this port Please set the server SQL mode. v Enable Strict Mode his option forces the server to behave more like a traditional database server. It is recommended to enable this option < Back Next Cancel 12)下一步选择默认编码,由于我们的学习中经常会运用到中文,为了方便中文 的处理和实现,在这一步中选择“ Best Support For Multilingualism”,这个 选项使用UTF8编码,UTF8编码支持几乎所有语言的编码。点击“Next”按 钮
11) 下一步进行网络设置,选中“Enable TCP/IP Networking”,端口号选用 默认的 3306 即可,选中“Add firewall exception for this port”复选框; 选 中“Enable Strict Mode”点击“Next”按钮 12) 下一步选择默认编码,由于我们的学习中经常会运用到中文,为了方便中文 的处理和实现,在这一步中选择“Best Support For Multilingualism”,这个 选项使用 UTF8 编码,UTF8 编码支持几乎所有语言的编码。点击“Next”按 钮
MySQL Server Instance Configuration Wizard MySQL Server Instance Configuration Configure the MySQL Server 5.0 server instance Please select the default character set C Standard Character Set ello) Makes Latin1 the default charset. This character set is suited for English and other West European languages F Best Support For Multilingualism B*g Make UTF8 the default character set. This is the recommended character set for storing text in many different languages C Manual Selected Default Character Set/Collation Please specify the character set to use. Character Set: tin1 Back Next> 13)下一步设置 Windows选项,选中“ Install As Windows Service”,设置 服务名称为“ MySQL”。如果需要在开机是自动启动 MySQL,则勾选“ Launch 他和 MySql Server automatically”。选中“ Include Bin Directory in Windows path”,使得MysρL的路径添加到 Windows路径
13) 下一步设置 Windows 选项,选中“Install As Windows Service”,设置 服务名称为“MySQL”。如果需要在开机是自动启动 MySQL,则勾选“Launch 他和 MySql Server automatically”。选中“Include Bin Directory in Windows PATH”,使得 MySQL 的路径添加到 Windows 路径
MySQL Server Instance Configuration Configure the MySQL Server 5.0 server instance. Please set the windows options v Install As Windows Service This is the recommended way to run the MySQL server on Windows v Launch the MySQL Server automatically y Include Bin Directory in Windows PATH Check this option to indude the directory containing the MysaL. server/dient executables in the Windows PATH variable so they can be called from the command line. Back Next Cancel 14)下一步,先选中“ Modify Security Setting”设定用户(root)密码, MySQL 中的root帐户相当于超级用户。为了系统安全,不用选中“ Enable root access from remote machines”复选框。不用选中“ Create An anony 创建匿名账号。设定完毕后,点击“Next”按钮
14) 下一步,先选中“Modify Security Setting”设定用户(root)密码,MySQL 中的 root 帐户相当于超级用户。为了系统安全,不用选中“Enable root access from remote machines”复选框。不用选中“Create An Anonymous Account” 创建匿名账号。设定完毕后,点击“Next”按钮