Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding MySQL cheatsheets #93

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kirarasmile
Copy link

No description provided.

Comment on lines 63 to 65



Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多余空行

DROP TABLE tb_name; # 删除表

SELECT * FROM <表名>; # 查询数据
INSERT INTO <表名> (字段1,字段2....字段N) VALUES (值1,值2....值N); # 查询数据
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
INSERT INTO <表名> (字段1,字段2....字段N) VALUES (值1,值2....值N); # 查询数据
INSERT INTO <表名> (字段1,字段2....字段N) VALUES (值1,值2....值N); # 插入数据

# MySQL增删改查
##############################################################################

mysql -uuser -ppwd -e "MY SQL QUERY" &>> query.log & disown # 静默执行SQL查询语句并输出到query.log中
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mysql -uuser -ppwd -e "MY SQL QUERY" &>> query.log & disown # 静默执行SQL查询语句并输出到query.log中
mysql -uuser -ppwd -e "SQL QUERY" &>> query.log & disown # 静默执行SQL查询语句并输出到query.log中

# MySQL备份与还原
##############################################################################

mysqldump -h hostname -u username -p db_name -P port > filename.sql # 导出数据
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mysqldump -h hostname -u username -p db_name -P port > filename.sql # 导出数据
mysqldump -h hostname -u username -p db_name -P port > filename.sql # 导出数据

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants