-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
base: master
Are you sure you want to change the base?
Conversation
databases/mysql.txt
Outdated
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多余空行
databases/mysql.txt
Outdated
DROP TABLE tb_name; # 删除表 | ||
|
||
SELECT * FROM <表名>; # 查询数据 | ||
INSERT INTO <表名> (字段1,字段2....字段N) VALUES (值1,值2....值N); # 查询数据 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INSERT INTO <表名> (字段1,字段2....字段N) VALUES (值1,值2....值N); # 查询数据 | |
INSERT INTO <表名> (字段1,字段2....字段N) VALUES (值1,值2....值N); # 插入数据 |
databases/mysql.txt
Outdated
# MySQL增删改查 | ||
############################################################################## | ||
|
||
mysql -uuser -ppwd -e "MY SQL QUERY" &>> query.log & disown # 静默执行SQL查询语句并输出到query.log中 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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中 |
databases/mysql.txt
Outdated
# MySQL备份与还原 | ||
############################################################################## | ||
|
||
mysqldump -h hostname -u username -p db_name -P port > filename.sql # 导出数据 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mysqldump -h hostname -u username -p db_name -P port > filename.sql # 导出数据 | |
mysqldump -h hostname -u username -p db_name -P port > filename.sql # 导出数据 |
No description provided.