MySQL学习足迹记录01--SOURCE,SHOW_MySQL
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

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Pinduoduo software provides a lot of good products, you can buy them anytime and anywhere, and the quality of each product is strictly controlled, every product is genuine, and there are many preferential shopping discounts, allowing everyone to shop online Simply can not stop. Enter your mobile phone number to log in online, add multiple delivery addresses and contact information online, and check the latest logistics trends at any time. Product sections of different categories are open, search and swipe up and down to purchase and place orders, and experience convenience without leaving home. With the online shopping service, you can also view all purchase records, including the goods you have purchased, and receive dozens of shopping red envelopes and coupons for free. Now the editor has provided Pinduoduo users with a detailed online way to view purchased product records. method. 1. Open your phone and click on the Pinduoduo icon.

How to View Command History in Linux In Linux, we use the history command to view the list of all previously executed commands. It has a very simple syntax: history Some options for pairing with the history command include: Option description -c clears the command history for the current session -w writes the command history to a file -r reloads the command history from the history file -n Limit the number of output of recent commands Simply run the history command to see a list of all previously executed commands in a Linux terminal: In addition to viewing command history, you can also manage command history and perform modifications to previously executed commands , reverse search command history or even delete history completely

Call recording in iPhone is often underestimated and is one of the most critical features of iPhone. With its simplicity, this feature is of vital importance and can provide important insights about the calls made or received on the device. Whether for work purposes or legal proceedings, the ability to access call records can prove invaluable. In simple terms, call history refers to the entries created on your iPhone whenever you make or receive a call. These logs contain key information, including the contact's name (or number if not saved as a contact), timestamp, duration, and call status (dialed, missed, or not answered). They are a concise record of your communication history. Call history includes call history strips stored on your iPhone

iPhone lets you add medications to the Health app to track and manage the medications, vitamins and supplements you take every day. You can then log medications you've taken or skipped when you receive a notification on your device. After you log your medications, you can see how often you took or skipped them to help you track your health. In this post, we will guide you to view the log history of selected medications in the Health app on iPhone. A short guide on how to view your medication log history in the Health App: Go to the Health App>Browse>Medications>Medications>Select a Medication>Options&a

C# Development Suggestions: Logging and Monitoring System Summary: In the software development process, logging and monitoring systems are crucial tools. This article will introduce the role and implementation suggestions of logging and monitoring systems in C# development. Introduction: Logging and monitoring are essential tools in large-scale software development projects. They can help us understand the running status of the program in real time and quickly discover and solve problems. This article will discuss how to use logging and monitoring systems in C# development to improve software quality and development efficiency. The role of logging system

How to log and monitor Java development projects 1. Background introduction With the rapid development of the Internet, more and more companies have begun to develop Java and build various types of applications. In the development process, logging and monitoring are an important link that cannot be ignored. Through logging and monitoring, developers can discover and solve problems in time to ensure the stability and security of applications. 2. The importance of logging 1. Problem tracking: When an application error occurs, logging can help us quickly locate the problem.

Official documentation: https://docs.ansible.com/ansible/latest/command_guide/intro_adhoc.html Introduction Ad-hoc command is a command that is temporarily entered and executed, usually used for testing and debugging. They do not need to be saved permanently. Simply put, ad-hoc is "instant command". Commonly used modules 1. command module (default module) The default module is not as powerful as the shell. Basically, the shell module can support the functions of the command module. 【1】Help ansible-doccommand# It is recommended to use the following ansible-doccomm

How to clear iPhone history in Safari? To clear your browsing and search history on Apple's Safari, you need to open the Settings app on your device. After selecting Settings, you need to scroll down and select Safari, then another menu will appear and you need to select Clear History and Website Data. You now need to select Clear History and Data from the menu, which will delete all search history, browsing history, cookies, and data from Apple’s Safari browser. That's it, all your previous browsing history and search history are now deleted from Safari. If you don’t want to delete all search history in Safari
