MYSQL show engine等实用 command

看DB参数和数据用:show status;

>>show tables from information_schema;

+---------------------------------------+

| Tables_in_information_schema          |

+---------------------------------------+

| CHARACTER_SETS                        |

| COLLATIONS                            |

| COLLATION_CHARACTER_SET_APPLICABILITY |

| COLUMNS                               |

| COLUMN_PRIVILEGES                     |

| ENGINES                               |

| EVENTS                                |

| FILES                                 |

| GLOBAL_STATUS                         |

| GLOBAL_VARIABLES                      |

| KEY_COLUMN_USAGE                      |

| OPTIMIZER_TRACE                       |

| PARAMETERS                            |

| PARTITIONS                            |

| PLUGINS                               |

| PROCESSLIST                           |

| PROFILING                             |

| REFERENTIAL_CONSTRAINTS               |

| ROUTINES                              |

| SCHEMATA                              |

| SCHEMA_PRIVILEGES                     |

| SESSION_STATUS                        |

| SESSION_VARIABLES                     |

| STATISTICS                            |

| TABLES                                |

| TABLESPACES                           |

| TABLE_CONSTRAINTS                     |

| TABLE_PRIVILEGES                      |

| TRIGGERS                              |

| USER_PRIVILEGES                       |

| VIEWS                                 |

| INNODB_CMP_RESET                      |

| INNODB_FT_CONFIG                      |

| INNODB_SYS_DATAFILES                  |

| INNODB_TRX                            |

| INNODB_SYS_TABLESTATS                 |

| ndb_transid_mysql_connection_map      |

| INNODB_FT_BEING_DELETED               |

| INNODB_LOCKS                          |

| INNODB_CMP_PER_INDEX                  |

| INNODB_BUFFER_PAGE_LRU                |

| INNODB_FT_DELETED                     |

| INNODB_CMPMEM_RESET                   |

| INNODB_LOCK_WAITS                     |

| INNODB_CMP                            |

| INNODB_SYS_INDEXES                    |

| INNODB_SYS_TABLES                     |

| INNODB_SYS_FIELDS                     |

| INNODB_CMP_PER_INDEX_RESET            |

| INNODB_BUFFER_PAGE                    |

| INNODB_FT_DEFAULT_STOPWORD            |

| INNODB_FT_INDEX_TABLE                 |

| INNODB_FT_INDEX_CACHE                 |

| INNODB_SYS_TABLESPACES                |

| INNODB_METRICS                        |

| INNODB_SYS_FOREIGN_COLS               |

| INNODB_CMPMEM                         |

| INNODB_BUFFER_POOL_STATS              |

| INNODB_SYS_COLUMNS                    |

| INNODB_SYS_FOREIGN                    |

+---------------------------------------+

MySQL>> show create table ossOperationType;

| Table            | Create Table                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                               
                                                                                                                                     |

+---------------------------------------------

| ossOperationType | CREATE TABLE `ossOperationType` (

`ossOperationTypeId` binary(1) NOT NULL,

`ssInThePLMNId` binary(2) NOT NULL,

`mobileNetworkCodeId` binary(3) NOT NULL,

`mobileCountryCodeId` binary(3) NOT NULL,

`stringIA5` binary(17) DEFAULT NULL,

`stringUssd` binary(17) DEFAULT NULL,

`stringUcs2` binary(17) DEFAULT NULL,

`ossOperationTypeTime` bigint(20) /*!50606 COLUMN_FORMAT DYNAMIC */ DEFAULT NULL,

PRIMARY KEY (`ossOperationTypeId`,`ssInThePLMNId`,`mobileNetworkCodeId`,`mobileCountryCodeId`) USING HASH

) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COLLATE=latin1_bin

/*!50100 PARTITION BY KEY (ossOperationTypeId) */ |

+---------------------+

1 row in set (0.01 sec)

mysql> show status;

...

.....

mysql> show processlist;

+------+-------------+-----------------+------+---------+--------+-----------------------------------------------------------------------------+------------------+

| Id   | User        | Host            | db   | Command | Time   | State                                                                       | Info             |

+------+-------------+-----------------+------+---------+--------+-----------------------------------------------------------------------------+------------------+

|    1 | system user |                 |      | Daemon  |      1 | Waiting for event from ndbcluster                                           | NULL             |

|    2 | dbsup       | STATION_A:59079 | NULL | Sleep   |      1 |                                                                             | NULL             |

|    3 | system user |                 | NULL | Connect | 490535 | Waiting for master to send event                                            | NULL             |

|    4 | system user |                 | NULL | Connect |      1 | Slave has read all relay log; waiting for the slave I/O thread to update it | NULL             |

| 9721 | admin       | localhost       | hlr  | Query   |      0 | init                                                                        | show processlist |

+------+-------------+-----------------+------+---------+--------+-----------------------------------------------------------------------------+------------------+

5 rows in set (0.00 sec)

看存储引擎参数:

mysql> show engine innodb status\G;

*************************** 1. row ***************************

Type: InnoDB

Name:

Status:

=====================================

2016-05-06 14:12:46 7f406e04c700 INNODB MONITOR OUTPUT

=====================================

Per second averages calculated from the last 22 seconds

-----------------

BACKGROUND THREAD

-----------------

srv_master_thread loops: 1 srv_active, 0 srv_shutdown, 488673 srv_idle

srv_master_thread log flush and writes: 488674

----------

SEMAPHORES

----------

OS WAIT ARRAY INFO: reservation count 2

OS WAIT ARRAY INFO: signal count 2

Mutex spin waits 0, rounds 0, OS waits 0

RW-shared spins 2, rounds 60, OS waits 2

RW-excl spins 0, rounds 0, OS waits 0

Spin rounds per wait: 0.00 mutex, 30.00 RW-shared, 0.00 RW-excl

------------

TRANSACTIONS

------------

Trx id counter 5381

Purge done for trx‘s n:o < 0 undo n:o < 0 state: running but idle

History list length 0

LIST OF TRANSACTIONS FOR EACH SESSION:

---TRANSACTION 0, not started

MySQL thread id 9721, OS thread handle 0x7f406e04c700, query id 7570041 localhost admin init

show engine innodb status

--------

FILE I/O

--------

I/O thread 0 state: waiting for i/o request (insert buffer thread)

I/O thread 1 state: waiting for i/o request (log thread)

I/O thread 2 state: waiting for i/o request (read thread)

I/O thread 3 state: waiting for i/o request (read thread)

I/O thread 4 state: waiting for i/o request (read thread)

I/O thread 5 state: waiting for i/o request (read thread)

I/O thread 6 state: waiting for i/o request (write thread)

I/O thread 7 state: waiting for i/o request (write thread)

I/O thread 8 state: waiting for i/o request (write thread)

I/O thread 9 state: waiting for i/o request (write thread)

Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,

ibuf aio reads: 0, log i/o‘s: 0, sync i/o‘s: 0

Pending flushes (fsync) log: 0; buffer pool: 0

318 OS file reads, 5 OS file writes, 5 OS fsyncs

0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s

-------------------------------------

INSERT BUFFER AND ADAPTIVE HASH INDEX

-------------------------------------

Ibuf: size 1, free list len 0, seg size 2, 0 merges

merged operations:

insert 0, delete mark 0, delete 0

discarded operations:

insert 0, delete mark 0, delete 0

Hash table size 276707, node heap has 0 buffer(s)

0.00 hash searches/s, 0.00 non-hash searches/s

---

LOG

---

Log sequence number 1626067

Log flushed up to   1626067

Pages flushed up to 1626067

Last checkpoint at  1626067

0 pending log writes, 0 pending chkp writes

8 log i/o‘s done, 0.00 log i/o‘s/second

----------------------

BUFFER POOL AND MEMORY

----------------------

Total memory allocated 137363456; in additional pool allocated 0

Dictionary memory allocated 59957

Buffer pool size   8192

Free buffers       8023

Database pages     169

Old database pages 0

Modified db pages  0

Pending reads 0

Pending writes: LRU 0, flush list 0, single page 0

Pages made young 0, not young 0

0.00 youngs/s, 0.00 non-youngs/s

Pages read 169, created 0, written 1

0.00 reads/s, 0.00 creates/s, 0.00 writes/s

No buffer pool page gets since the last printout

Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s

LRU len: 169, unzip_LRU len: 0

I/O sum[0]:cur[0], unzip sum[0]:cur[0]

--------------

ROW OPERATIONS

--------------

0 queries inside InnoDB, 0 queries in queue

0 read views open inside InnoDB

Main thread process no. 479821, id 139913752205056, state: sleeping

Number of rows inserted 0, updated 0, deleted 0, read 0

0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s

----------------------------

END OF INNODB MONITOR OUTPUT

============================

1 row in set (0.00 sec)

ERROR:

No query specified

mysql> show engine ndbcluster status\G;

*************************** 1. row ***************************

Type: ndbcluster

Name: connection

Status: cluster_node_id=116, connected_host=STATION_A, connected_port=2200, number_of_data_nodes=14, number_of_ready_data_nodes=14, connect_count=0

*************************** 2. row ***************************

Type: ndbcluster

Name: NdbTransaction

Status: created=14, free=14, sizeof=368

*************************** 3. row ***************************

Type: ndbcluster

Name: NdbOperation

Status: created=28, free=28, sizeof=944

*************************** 4. row ***************************

Type: ndbcluster

Name: NdbIndexScanOperation

Status: created=0, free=0, sizeof=1152

*************************** 5. row ***************************

Type: ndbcluster

Name: NdbIndexOperation

Status: created=0, free=0, sizeof=952

*************************** 6. row ***************************

Type: ndbcluster

Name: NdbRecAttr

Status: created=0, free=0, sizeof=88

*************************** 7. row ***************************

Type: ndbcluster

Name: NdbApiSignal

Status: created=16, free=16, sizeof=144

*************************** 8. row ***************************

Type: ndbcluster

Name: NdbLabel

Status: created=0, free=0, sizeof=200

*************************** 9. row ***************************

Type: ndbcluster

Name: NdbBranch

Status: created=0, free=0, sizeof=32

*************************** 10. row ***************************

Type: ndbcluster

Name: NdbSubroutine

Status: created=0, free=0, sizeof=72

*************************** 11. row ***************************

Type: ndbcluster

Name: NdbCall

Status: created=0, free=0, sizeof=24

*************************** 12. row ***************************

Type: ndbcluster

Name: NdbBlob

Status: created=0, free=0, sizeof=496

*************************** 13. row ***************************

Type: ndbcluster

Name: NdbReceiver

Status: created=0, free=0, sizeof=128

*************************** 14. row ***************************

Type: ndbcluster

Name: NdbLockHandle

Status: created=0, free=0, sizeof=48

*************************** 15. row ***************************

Type: ndbcluster

Name: binlog

Status: latest_epoch=2005758317166600, latest_trans_epoch=2005758317166596, latest_received_binlog_epoch=2005758317166600, latest_handled_binlog_epoch=2005758317166600, latest_applied_binlog_epoch=2005758317166596

15 rows in set (0.00 sec)

ERROR:

No query specified

时间: 2024-11-05 16:34:42

MYSQL show engine等实用 command的相关文章

mysql的engine不同,导致事物回滚失败的问题

近期在项目上遇到遇到一个头疼的问题,前方销售团队反馈了一个客户那边在创建用户(save object to DB)报错了以后,前台展示了错误,但是数据库却保存了这条记录. 接到这个BUG以后,第一时间查看了事物是否正确回滚,排查了代码后发现事物回滚成功,并且在我的环境下回滚成功,错误没有复现, 这个时候就比较棘手了,客户的事物回滚失败,但是我们的回滚成功,我们的项目使用的是grails框架做的,查询了grails声明性事物回滚的规则,我们的代码没有问题,那我就把问题转移到了数据库身上, 要了客户

zblog写作:ms-sql和mysql数据库哪个更加实用?

最近在坚持写博客,在建立博客之前,就思考了一个很重要的问题:ms-sql和mysql数据库哪个更加实用?或许很多人都不明白我为什么要思考这个问题,因为大多博主都会觉得PHP+mysql不是很绝佳的搭配吗?是的,而且zblog也开发除了php语言的系统,对于我们用户来说,确实比较方便,但不要忘记了,PHP虽然强大,但zblog-php系统并不是很完美,尤其是在生成纯静态文件html的时候,做不到,这非常郁闷啊.因此,我建立博客的时候,就首先考虑了纯静态化的问题,而不是用伪静态和动态网页来进行访问网

mysql中engine=innodb和engine=myisam的区别

MyISAM类型不支持事务处理等高级处理,而InnoDB类型支持. MyISAM 类型的表强调的是性能,其执行数度比InnoDB类型更快,但是不提供事务支持. InnoDB 提供事务支持以及外键等高级数据库功能. 这样就可以根据数据表不同的用处是用不同的存储类型. 另外,MyISAM类型的二进制数据文件,可以在不同操作系统中迁移. 也就是可以直接从 Windows 系统拷贝到 linux 系统中使用. 修改: ALTER TABLE tablename ENGINE = MyISAM : MyI

Mysql中ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8怎么转换为sql sever2008的代码

ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8转换sql server AUTO_INCREMENT=2 ,是 自动递增列的 初始数值 = 2,SQL Server 通过 IDENTITY 来设置DEFAULT CHARSET=utf8 DEFAULT CHARSET=utf8,默认字符集 = utf8SQL Server 里面.text. 指定列的排序规则ENGINE=InnoDB ,是 MySQL 的数据库引擎的设置,一个是"初始值&q

mysql federated engine

mysql> create table fb (id int , msg char(2)) -> engine=federated -> connection='mysql://[email protected]:3306/t1/t';

Linux / mysql: is it safe to copy mysql db files with cp command from one db to another?

Copying is very simple for MyISAM and completely 100% risky (near suicidal) with InnoDB. From your question, you brought up cp /db1/mytable.frm /db2/mytable.frm MyISAM This is OK to do. However, you cannot just move the .frm. You must move all compon

phpStudy——mysql修改engine引擎注意事项

关于注掉skip-innodb选项也不能启用innoDB引擎的解决办法 本人之前用的是wamp集成环境的数据库,为了方便直接将data文件复制过来. 可后来发现phpstudy的数据库设置的默认引擎是MyISAM,但如果要从其他数据库导入InnoDB引擎的数据库是不行的,网上很多关于启用InnoDB的办法,都是注释掉skip-innodb选项,可发现还是不行. 终于找到问题了,实际上,还需要删除下面类似文件方可正常启动: C:\Program Files\MySQL\MySQL Server 5

MySQL 学习五 SQL实用函数

0 select now() 显示当前时间. 1 select char_length('andyqan')   显示字符长度. 2 日期格式化         select date_format(now(), '%y-%m-%d') 3 添加/减少日期时间         select date_add(now(), interval 1 day) 4 类型转换       select cast(187000000  as char) 5 加密函数 MD5是不可逆的,也就是不可破解的. 但

mysql中engine=innodb和engine=myisam的区别(转)

转自http://blog.csdn.net/lingyi_xu/article/details/5393791 innodb引擎和mysiam引擎的区别 引擎         事务     外键 建议操作 INNODB         支持 支持 增加.修改             MYISAM         不支持 不支持 查询 MYISAM是比INNODB执行效率高