显示表SQL命令

MySQL is open-source relational database management software that website owners and others use to organize and retrieve data from databases. A database consists of one or more tables with several columns, each containing information. In relational databases, the tables can cross-reference one another. If you run a website and use MySQL, you may need to view a complete list of tables in the database.

MySQL是开源关系数据库管理软件,网站所有者和其他人使用它来组织和检索数据库中的数据。 数据库由一个或多个具有几列的表组成,每列包含信息。 在关系数据库中,表可以相互交叉引用。 如果您运行网站并使用MySQL,则可能需要查看数据库中表的完整列表。

使用MySQL命令行客户端 ( Using the MySQL Command Line Client )

Connect to your web server and log in to your database. Pick the database you want to use if you have more than one. In this example, the database is named "Pizza Store."

连接到您的Web服务器并登录到数据库。 如果您有多个数据库,请选择您要使用的数据库。 在此示例中,数据库名为“ Pizza Store”。


$ mysql -u root -p
mysql> USE pizza_store;

Now use the MySQL SHOW TABLES command to list the tables in the chosen database.

现在,使用MySQL SHOW TABLES命令列出所选数据库中的表。


mysql> SHOW TABLES;

This command returns a list of all the tables in the chosen database.

此命令返回所选数据库中所有表的列表。

MySQL技巧 ( MySQL Tips  )

  • Every MySQL command ends with a semicolon. If it is missing, the command does not execute.

    每个MySQL命令以分号结尾。 如果缺少该命令,则不会执行。
  • The MySQL command line is not case sensitive, but commands are usually written in uppercase, while tables, databases, usernames, and text are usually in lowercase to make them easier to identify.

    MySQL命令行不区分大小写,但是命令通常以大写形式编写,而表,数据库,用户名和文本通常以小写形式编写,以便于识别。

何时使用数据库 ( When to Use a Database )

A database is a structured collection of data. Occasions when a database might come in handy when you are working on your website include:

数据库是结构化的数据集合。 当您在网站上工作时,数据库可能派上用场的场合包括:

  • If you have an online store, a database stores the products you sell, the customer information, and the orders.

    如果您有在线商店,则数据库将存储您出售的产品,客户信息和订单。
  • A database for an online forum stores member names, forums, topics, and posts.

    在线论坛的数据库存储成员名称,论坛,主题和帖子。
  • A blog uses a database to store blog posts, categories, comments, and tags.

    博客使用数据库来存储博客文章,类别,评论和标签。

为什么要使用MySQL ( Why Use MySQL )

  • Because it is open-source software, it is free to everybody.

    因为它是开源软件,所以它对所有人都是免费的。
  • MySQL can be installed on lots of different platforms.

    MySQL可以安装在许多不同的平台上。
  • MySQL is usually included in most web-hosting packages.

    大多数网络托管软件包中通常都包含MySQL。
  • It's easy to use.

    易于使用。
  • It works well with PHP to add functionality to your website.

    它与PHP配合使用,可以为您的网站添加功能。

翻译自: https://www.thoughtco.com/show-tables-sql-command-2693987

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值