Chapter 3 Tutorial

第三章 辅导教程

Table of Contents  

目录   

  • 3.1 Connecting to and Disconnecting from the Server

  • 3.1连接和断开与服务器的连接  

  • 3.2 Entering Queries

  • 3.2输入查询

  • 3.3 Creating and Using a Database    

  • 3.3创建和使用数据库    

  • 3.4 Getting Information About Databases and Tables

  • 3.4获取有关数据库和表的信息

  • 3.5 Using mysql in Batch Mode

  • 3.5在批处理模式下使用mysql

  • 3.6 Examples of Common Queries     

  • 3.6常见查询示例     

  • 3.7 Using MySQL with Apache

  • 3.7在Apache中使用Mysql

This chapter provides a tutorial introduction to MySQL by showing how to use the mysql client program to create and use a simple database. mysql (sometimes referred to as the terminal monitor or just monitor) is an interactive program that enables you to connect to a MySQL server, run queries, and view the results. mysql may also be used in batch mode: you place your queries in a file beforehand, then tell mysql to execute the contents of the file. Both ways of using mysql are covered here.

本章通过介绍如何使用mysql客户端程序来创建和使用简单的数据库,提供了MySQL的教程介绍mysql(有时称为“ 终端监视器 ”或 “ 监视器 ”)是一种交互式程序,可以连接到MySQL服务器,运行查询并查看结果。 mysql也可能在批处理模式下使用:您先将查询放在一个文件中,然后告诉 mysql执行该文件的内容。这里介绍了使用mysql的两种方法

To see a list of options provided by mysql, invoke it with the --help option:

要查看mysql提供的选项列表,请使用以下--help选项来调用它

shell> mysql --help

This chapter assumes that mysql is installed on your machine and that a MySQL server is available to which you can connect. If this is not true, contact your MySQL administrator. (If you are the administrator, you need to consult the relevant portions of this manual, such as Chapter 5, MySQL Server Administration.)

本章假设您的机器上安装mysql,并且可以使用MySQL服务器连接。如果这不正确,请与您的MySQL管理员联系。(如果 是管理员,则需要参考本手册的相关部分,如 第5章MySQL服务器管理。)

This chapter describes the entire process of setting up and using a database. If you are interested only in accessing an existing database, you may want to skip over the sections that describe how to create the database and the tables it contains.

本章介绍设置和使用数据库的整个过程。如果您仅对访问现有数据库感兴趣,可能需要跳过描述如何创建数据库及其包含的表的部分。

Because this chapter is tutorial in nature, many details are necessarily omitted. Consult the relevant sections of the manual for more information on the topics covered here.

因为本章是辅导教程,许多细节必然被省略。有关本文涉及的主题的更多信息,请参阅手册的相关章节。