创建数据库
查看数据库:
mariadb root@localhost:(none)> show databases
+--------------------+
| Database |
+--------------------+
| information_schema |
| Market |
| mysql |
| performance_schema |
| word |
+--------------------+
5 rows in set
Time: 0.028s
查看数据库定义:
mariadb root@localhost:(none)> show create database test_db
+----------+--------------------------------------------------------------------+
| Database | Create Database |
+----------+--------------------------------------------------------------------+
| test_db | CREATE DATABASE `test_db` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------+--------------------------------------------------------------------+
1 row in set
Time: 0.027s
创建数据库:
mariadb root@localhost:(none)> create database test_db;
Query OK, 1 row affected
Time: 0.005s
mariadb root@localhost:(none)> show databases
+--------------------+
| Database |
+--------------------+
| information_schema |
| Market |
| mysql |
| performance_schema |
| test_db |
| word |
+--------------------+
6 rows in set
Time: 0.044s
删除数据库:
mariadb root@localhost:(none)> drop database test_db;
You\'re about to run a destructive command.
Do you want to proceed? (y/n): y
Your call!
Query OK, 0 rows affected
Time: 0.004s
mariadb root@localhost:(none)> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| Market |
| mysql |
| performance_schema |
| word |
+--------------------+
5 rows in set
Time: 0.021s
数据库存储引擎:
查看所有引擎:
mariadb root@localhost:(none)> show engines;
+--------------------+---------+----------------------------------------------------------------------------+--------------+-----+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------+--------------+-----+------------+
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV storage engine | 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 |
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------------------+--------------+-----+------------+
10 rows in set
Time: 0.035s
更多请看数据库引擎简介