当前位置:网站首页>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 .
边栏推荐
- [网摘][医学影像] 常用的DICOM缩略图解释以及Viewer converter 转换工具
- Implicit indicators for evaluating the advantages and disadvantages of automated testing
- I/o instance operation
- 2021-3-22-tencent - minimum number of guards
- Newticker uses
- Advance in the flutter project_ image_ Picker component usage
- 浪潮之巅——读书笔记+摘录+感悟
- 我在英国TikTok做直播电商
- Watermelon Book + pumpkin book chapter 1-2
- 20210422 consolidation interval
猜你喜欢

20210519 leetcode double pointer

图像分割 vs Adobephotoshop(PS)

Image segmentation vs Adobe Photoshop (PS)

解决方案:idea project没有显示树状图
Several rounds of SQL queries in a database

Advance in the flutter project_ image_ Picker component usage

(10) STM32 - systick tick timer

Shutter project scrollcontroller attached to multiple scroll views, failed assertion: line 109 POS 12 error handling

Watermelon Book + pumpkin book chapter 1-2

The first case of monkeypox in pregnant women in the United States: the newborn was injected with immunoglobulin and was safely born
随机推荐
Common usage of curl command
Makefile template
Guangdong's finance has taken many measures to help stabilize the "ballast stone" of food security
go语言之sync.Map
Solution: can not issue executeupdate() or executelargeupdate() for selections
Play CSDN editor
Current situation and development trend of accounting computerization
Newticker uses
Complete data summary of lapsus$apt organization that stole Microsoft's source code in March 2022
Detailed explanation of deeplab series (simple and practical annual summary)
2021-3-23-meituan-regular sequence
Flash quickly builds an API
Ali II: what if the AOF file in redis is too large?
Sync.map of go language
Detailed explanation of flask framework
象棋机器人「弄折了」棋童的手指。。。
系统临时文件的写和读:createTempFile和tempFileContent[通俗易懂]
I/o instance operation
Solution: the idea project does not display a tree view
The chess robot "broke" the chess boy's finger...