bitsCN.com
mysql学习足迹记录01--source,show
1.导入数据
command: SOURCE <PATH> <data.sql>; eg: mysql> source ~/MyDoc/create.sql;
2.SHOW COLUMNS FROM
eg: mysql> SHOW COLUMNS FROM orders;+------------+----------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+------------+----------+------+-----+---------+----------------+| order_num | int(11) | NO | PRI | NULL | auto_increment || order_date | datetime | NO | | NULL | || cust_id | int(11) | NO | MUL | NULL | |+------------+----------+------+-----+---------+----------------+mysql> DESCRIBE orders;+------------+----------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+------------+----------+------+-----+---------+----------------+| order_num | int(11) | NO | PRI | NULL | auto_increment || order_date | datetime | NO | | NULL | || cust_id | int(11) | NO | MUL | NULL | |+------------+----------+------+-----+---------+----------------+
3.显示服务器状态信息
command: SHOW STATUS; eg: mysql> SHOW STATUS;+------------------------------------------+-------------+| Variable_name | Value |+------------------------------------------+-------------+| Aborted_clients | 0 || Aborted_connects | 0 | ......... .........
4.显示授予用户
command: SHOW GRANTS; eg: mysql> SHOW GRANTS;+----------------------------------------------------------------------------------------------------------------------------------------+| Grants for root@localhost ....... .......
5.显示错误信息
command: SHOW ERRORS; eg: mysql> SHOW ERRORS;+-------+------+----------------------------------------------------------------------------------------------------------------------------------------------------+| Level | Code | Message ....... .......
6.显示警告信息
command: SHOW WARMMINGS; eg: mysql> SHOW WARMMINGS;ERROR 1064 (42000): You have an error in your SQL syntax; ....... .......
7.显示创建特定数据库的语句
command: SHOW CREATE DATABASE <database_name>; eg: mysql> SHOW CREATE DATABASE MySQL_ex;+----------+---------------------------------------------------------------------+| Database | Create Database |+----------+---------------------------------------------------------------------+| MySQL_ex | CREATE DATABASE `MySQL_ex` /*!40100 DEFAULT CHARACTER SET latin1 */ |+----------+---------------------------------------------------------------------+1 row in set (0.00 sec)
8.显示创建特定表格的语句
command: SHOW CREATE TABLE <database_name>; eg: mysql> SHOW CREATE TABLE orders;+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table |+--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| orders | CREATE TABLE `orders` ( `order_num` int(11) NOT NULL AUTO_INCREMENT, `order_date` datetime NOT NULL, `cust_id` int(11) NOT NULL, PRIMARY KEY (`order_num`), KEY `fk_orders_customers` (`cust_id`), CONSTRAINT `fk_orders_customers` FOREIGN KEY (`cust_id`) REFERENCES `customers` (`cust_id`)) ENGINE=InnoDB AUTO_INCREMENT=20010 DEFAULT CHARSET=latin1 | ....
9.其他SHOW命令
HELP SHOW;
bitsCN.com
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
C++高性能并发应用_C++如何开发性能关键应用
Java AI集成Deep Java Library_Java怎么集成AI模型部署
Golang后端API开发_Golang如何高效开发后端和API
Python异步并发改进_Python异步编程有哪些新改进
C++系统编程内存管理_C++系统编程怎么与Rust竞争内存安全
Java GraalVM原生镜像构建_Java怎么用GraalVM构建高效原生镜像
Python FastAPI异步API开发_Python怎么用FastAPI构建异步API
C++现代C++20/23/26特性_现代C++有哪些新标准特性如modules和coroutines
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号