2013年7月4日 星期四

查詢MySQL 資料庫的編碼

SHOW CREATE DATABASE DBNAME;

mysql> SHOW CREATE DATABASE DbName;
+----------+-----------------------------------------------------------------+
| Database | Create Database                                                 |
+----------+-----------------------------------------------------------------+
| DbName   | CREATE DATABASE `DbName` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+-----------------------------------------------------------------+
1 row in set (0.00 sec)



也可以用
use DBNAME;
status;

mysql> use DBNAME;
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
mysql> status;
--------------
mysql  Ver 14.14 Distrib 5.5.32, for Linux (x86_64) using readline 5.1

Connection id:          313
Current database:       DBNAME
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.5.32-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:                 50 min 29 sec

Threads: 51  Questions: 62069  Slow queries: 492  Opens: 274  Flush tables: 1  Open tables: 216  Queries per second avg: 20.491
--------------

第二個指令可以看的比較細

沒有留言: