如何获取MySQL帮助信息(3)

--执行sql脚本文件
mysql> system more query.sql  --注意,此时为当前目录
use chardb
select * from tb_isam;
mysql> source query.sql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
+------+-------+
| id  | value |
+------+-------+
|    1 | a    |
|    2 | b    |
|    3 | c    |
|    4 | f    |
+------+-------+
4 rows in set (0.00 sec)

--获取状态信息
mysql> status;
--------------
mysql  Ver 14.14 Distrib 5.5.37, for Linux (x86_64) using readline 5.1

Connection id:          6
Current database:      chardb
Current user:          root@localhost
SSL:                    Not in use
Current pager:          less
Using outfile:          ''
Using delimiter:        ;
Server version:        5.5.37-log MySQL Community Server (GPL)
Protocol version:      10
Connection:            Localhost via UNIX socket
Server characterset:    latin1
Db    characterset:    utf8
Client characterset:    latin1
Conn.  characterset:    latin1
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                3 hours 10 min 59 sec

Threads: 1  Questions: 97  Slow queries: 0  Opens: 313  Flush tables: 1  Open tables: 51  Queries per second avg: 0.008
--------------

--修改客户端字符集
mysql> charset gbk;
Charset changed
mysql> \s
--------------
mysql  Ver 14.14 Distrib 5.5.37, for Linux (x86_64) using readline 5.1

Connection id:          6
Current database:      chardb
Current user:          root@localhost
SSL:                    Not in use
Current pager:          less
Using outfile:          ''
Using delimiter:        ;
Server version:        5.5.37-log MySQL Community Server (GPL)
Protocol version:      10
Connection:            Localhost via UNIX socket
Server characterset:    latin1
Db    characterset:    utf8
Client characterset:    gbk    ---客户端和conn端字符集都变成gbk了。
Conn.  characterset:    gbk
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                3 hours 13 min 33 sec

Threads: 1  Questions: 105  Slow queries: 0  Opens: 313  Flush tables: 1  Open tables: 51  Queries per second avg: 0.009
--------------

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/ca1e6db9d4579e87825cc48103e96d7e.html