mysql查看数据库表
时间: 2023-11-19 12:57:37 浏览: 89
要查看MySQL数据库中的表,可以使用SHOW TABLES;命令。具体步骤如下:
1.使用命令行工具登录到MySQL数据库。例如:mysql -u [用户名] -p
2.输入密码并按Enter键。
3.输入SHOW TABLES;命令并按Enter键。
4.系统将显示该数据库中的所有表。
以下是一个示例:
```mysql
mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.21-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SHOW TABLES;
+-----------------------+
| Tables_in_test_schema |
+-----------------------+
| customers |
| orders |
+-----------------------+
2 rows in set (0.00 sec)
```
阅读全文