今天自己巩固下自己关于mysql常用的命令。
附上:mysql 其他命令参数 -D,–dataname=name 打开指定数据库 -delimiter=name 指定分隔符(默认为;) -h,–host=name 服务器名称 -p,–password[=name] 密码 -P(大写),–port=name 端口号 –prompt=name 设置提示符 -u,–user=name 用户名 -V(大写),–version 输出版本信息并退出 2. 登出操作
1 mysql > exit 2 mysql > quit 3 mysql > \q1.prompt命令可以在mysql提示符中显示当前用户、数据库、时间等信息
mysql -uroot -p --prompt="\\u@\\h:\\d \\r:\\m:\\s>"2.mysql client中
mysql>Prompt [name];选项说明:
Option Description \c A counter that increments for each statement you issue \D The full current date \d The default database \h The server host \l The current delimiter (new in 5.1.12) \m Minutes of the current time \n A newline character \O The current month in three-letter format (Jan, Feb, …) \o The current month in numeric format \P am/pm \p The current TCP/IP port or socket file \R The current time, in 24-hour military time (0–23) \r The current time, standard 12-hour time (1–12) \S Semicolon \s Seconds of the current time \t A tab character \u username3.在my.cnf配置文件里进行配置
[mysql] prompt=mysql(\\u@\\h:\\d)> default-character-set=utf8