mysql --html -u ... -p ...
表示以html的方式登录mysql后台。命令都是以html的样式的结果输出。
example:
MariaDB [nova]> use nova; show tables;
Database changed
<TABLE BORDER=1><TR><TH>Tables_in_nova</TH></TR><TR><TD>app01_userinfo</TD></TR><TR><TD>auth_group</TD></TR><TR><TD>auth_group_permissions</TD></TR><TR><TD>auth_permission</TD></TR><TR><TD>auth_user</TD></TR><TR><TD>auth_user_groups</TD></TR><TR><TD>auth_user_user_permissions</TD></TR><TR><TD>django_admin_log</TD></TR><TR><TD>django_content_type</TD></TR><TR><TD>django_migrations</TD></TR><TR><TD>django_session</TD></TR></TABLE>11 rows in set (0.01 sec)
mysql中如何查看引擎:
MariaDB [nova]> show engines;
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
如何查看某个表的引擎:
MariaDB [nova]> show table status in mysql \G;
*************************** 1. row ***************************
Name: column_stats
Engine: MyISAM
Version: 10
Row_format: Dynamic
Rows: 0
Avg_row_length: 0
Data_length: 0
Max_data_length: 281474976710655
Index_length: 4096
Data_free: 0
Auto_increment: NULL
Create_time: 2017-03-11 02:22:18
Update_time: 2017-03-11 02:22:18
Check_time: NULL
Collation: utf8_bin
Checksum: NULL
Create_options:
Comment: Statistics on Columns
具体查看某个表的引擎:
SHOW TABLE STATUS from day20_test where Name='t5' \G;
创建表:
MariaDB [nova]> create table t5 select * from nova.app01_userinfo;
Query OK, 3 rows affected (0.14 sec)
Records: 3 Duplicates: 0 Warnings: 0
改变表的引擎:
alter table t5 engine=csv;