mysql 查看帮助
mysql> help;
For information about MySQL products and services, visit:
http://www.mysql.com/
For developer information, including the MySQL Reference Manual, visit:
http://dev.mysql.com/
To buy MySQL Enterprise support, training, or other products, visit:
https://shop.mysql.com/
List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
? (\?) Synonym for `help'.
clear (\c) Clear the current input statement.
connect (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
help (\h) Display this help.
notee (\t) Don't write into outfile.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute an SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
use (\u) Use another database. Takes database name as argument.
charset (\C) Switch to another charset. Might be needed for processing binlog
with multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.
For server side help, type 'help contents'
mysql> ? contents;
You asked for help about help category: "Contents"
For more information, type 'help
categories:
Account Management
Administration
Compound Statements
Data Definition
Data Manipulation
Data Types
Functions
Functions and Modifiers for Use with GROUP BY
Geographic Features
Help Metadata
Language Structure
Plugins
Procedures
Storage Engines
Table Maintenance
Transactions
User-Defined Functions
Utility
mysql> help utility;
You asked for help about help category: "Utility"
For more information, type 'help
topics:
EXPLAIN
HELP STATEMENT
USE
帮助具体内容
clear 相当于;
connect 重连数据库 connect mysql localhost;
delimiter
mysql> delimiter $$
mysql> select 1;
-> $$
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)
edit 调用vi
page 控制翻屏
pgger more
nopager 清掉
tee a.txt 输出到一个文件
create table dsg.t select * from information_schema.tables;
notee;
source 执行一个sql文件
system 调用操作系统文件
status 获取服务器状态信息
mysql> status
--------------
mysql Ver 14.14 Distrib 5.6.14, for Win64 (x86_64)
Connection id: 30
Current database:
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 5.6.14 MySQL Community Server (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 5 days 18 hours 16 min 30 sec
Threads: 15 Questions: 4861 Slow queries: 0 Opens: 117 Flush tables: 1 Open
tables: 109 Queries per second avg: 0.009
--------------
use 切换数据库
select database():
user test;
select database();
charset 设置字符集
charset gbk
warnings 打印错误信息
show warnings
rehash 自动补全;
vi my.cnf
auto-rehash
show create tables t \G;
? show variables;
?set 设置变量
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24577884/viewspace-1061247/ ,如需转载,请注明出处,否则将追究法律责任。