当前位置:网站首页>MySQL common commands
MySQL common commands
2022-07-27 12:26:00 【Coding_ Bryce】
mysql -u user name -p password # Connect to database
show databases; # Display database
use Database name ; # Access to database
show tables; # Display all tables in the current library
create table The new name of the table from select * from The old name of the table ; # Backup tables
create database Library name ; # Create database
drop database Database name ; # Delete database
creat table < Table name >(< Field name 1>< type 1>[...< Field name n>< type n>]); # Create table
drop table Table name ; # Delete table
DELETE FROM Table name ; # Clear the table
TRUNCATE Table name ; # Truncation table
update Data table name set Field = The new value ,...where Conditions ; # Modify table data
delect from Data table name where expression ; # Delete table data
alter table Data table name add Field type ; # Add fields
rename table Original table name to The new name of the table ; # Modify the name of the table
insert into Table name values ( Field list ); # Insert table data
mysqldump --opt test > mysql.test # About database test Export database to mysql.test text file
show status like 'thread%'; # see mysql Current connections
show variables like '%connections%'; # see mysql What's the maximum number of connections
Execute in batch on the command line .sql file
source .sql file ; # This is to execute a .sql Files can use commands , When there are many .sql We can choose to create a new file .sql file
# for example : We have 1.sql,2.sql.3.sql,4.sql,5.sql,6.sql,7.sql,8.sql,9.sql,10.sql, Here are ten sql The file needs to be executed , It needs to be executed ten times source command
At this time, we can create a new .sql file ,exp.sql, Here is exp.sql The content of the document
source 1.sql;
source 2.sql;
source 3.sql;
source 4.sql;
source 5.sql;
source 6.sql;
source 7.sql;
source 8.sql;
source 9.sql;
source 10.sql;
# Then we can execute once source exp.sql Just order .
边栏推荐
- I/O实例操作
- 【数据库数据恢复】SQL Server数据库所在磁盘分区空间不足报错的数据恢复案例
- Go Beginner (4)
- 解决方案:Can not issue executeUpdate() or executeLargeUpdate() for SELECTs
- Strictly control outdoor operation time! Foshan housing and Urban Rural Development Bureau issued a document: strengthening construction safety management during high temperature
- Go Beginner (3)
- MySQL paging query instance_ MySQL paging query example explanation "suggestions collection"
- USB network card drive data stream
- Kazoo tutorial
- Good looking (dynamic) Jay fan self-made dynamic album card (front and back are different) and lyrics page
猜你喜欢

About the problem that the onapplicationevent method of the custom listener is executed multiple times

Strictly control outdoor operation time! Foshan housing and Urban Rural Development Bureau issued a document: strengthening construction safety management during high temperature

STS download tutorial (the solution cannot be downloaded on the include official website)
One article to understand the index of like in MySQL

孤独的年轻人,戒不了Jellycat

严控室外作业时间!佛山住建局发文:加强高温期间建筑施工安全管理

Play CSDN editor

Chapter 7 exception handling

The first case of monkeypox in pregnant women in the United States: the newborn was injected with immunoglobulin and was safely born

20210519 leetcode double pointer
随机推荐
V-show failure
While loop instance in shell
Newticker uses
CMD Chinese garbled code solution
MySQL paging query instance_ MySQL paging query example explanation "suggestions collection"
2021-4-7-find the maximum water holding capacity
go语言之sync.Map
【产品】关于微信产品分析
After Party A's hard work, 49.08 million orders of China Mobile were scrapped
POJ1988_ Cube Stacking
2021-3-23-meituan-regular sequence
How to use the server to build our blog
广东:剧本杀等新行业新业态场所,消防安全监管不再“缺位”
Top of the tide - reading notes + excerpts + insights
2021-3-22-directed graph sorting
Docker Mysql的使用note
Go replace with local code
Top 10 in the 5.3 billion Bi Market: fansoft, Microsoft, Yonghong, sap, Baidu, IBM, SAS, smart, salesforce, Inspur soft
Fundamentals of mathematics 02 - sequence limit
2021-3-17-byte-hu Pai