Mysql----基础操作
- 创建数据库:create Database database_name
mysql> create Database test2; Query OK, 1 row affected (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | | test | | test2 | +--------------------+ 6 rows in set (0.00 sec)
- 查看数据库:show databases;
mysql> create Database test2; Query OK, 1 row affected (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | | test | | test2 | +--------------------+ 6 rows in set (0.00 sec)
- 选择数据库:use database_name
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | | test | | test2 | +--------------------+ 6 rows in set (0.00 sec) mysql> use information_schema; 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 #表示选择数据库成功
- 删除数据库:DROP DATABASE database_name
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | | test | | test2 | +--------------------+ 6 rows in set (0.00 sec) mysql> drop database test; Query OK, 0 rows affected (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | | test2 | +--------------------+ 5 rows in set (0.00 sec)
- 查询默认存储引擎:SHOW VARIABLES LIKE ‘storage_engine%‘;
mysql> show variables like ‘storage_engine%‘; Empty set (0.01 sec)
相关推荐
CoderToy 2020-11-16
bianruifeng 2020-11-16
云中舞步 2020-11-12
敏敏张 2020-11-11
暗夜之城 2020-11-11
好记忆也需烂 2020-11-11
Coder技术文摘 2020-09-29
huacuilaifa 2020-10-29
Gexrior 2020-10-22
lpfvip00 2020-10-07
云中舞步 2020-09-11
康慧欣 2020-09-10
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13