当前位置:网站首页>Basic database operations in MySQL
Basic database operations in MySQL
2022-07-19 12:40:00 【Operation and maintenance home】
1、 view the database
show databases;
This command can view the current database service , There are several databases , as follows :
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sakila |
| sys |
| world |
+--------------------+
6 rows in set (0.00 sec)
mysql>
2、 Create database
create database db_name;
This command can create a database , as follows :
mysql> create database yunweijia;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sakila |
| sys |
| world |
| yunweijia |
+--------------------+
7 rows in set (0.00 sec)
mysql>
Someone asked , How to check the status and process of database creation , Use the following command ;
show create database db_name
Example :
mysql> show create database yunweijia;
+-----------+-------------------------------------------------------------------------------------------------------------------------------------+
| Database | Create Database |
+-----------+-------------------------------------------------------------------------------------------------------------------------------------+
| yunweijia | CREATE DATABASE `yunweijia` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */ |
+-----------+-------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
In this way, we can see when we create the database , What parameters does he add to you by default .
3、 Delete database
If the database is deleted , The data in it has also been deleted , Be sure to operate with caution . Don't even do this .
drop database db_name;
as follows :
mysql> drop database yunweijia;
Query OK, 0 rows affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sakila |
| sys |
| world |
+--------------------+
6 rows in set (0.00 sec)
mysql>
4、mysql8.0 New characteristics , All is InnoDB type
from MySQL 8.0 Start , The system tables are all transactional InnoDB surface , default MySQL The instance will not contain any MyISAM surface , Unless you create it manually MyISAM surface .
select distinct(ENGINE) from information_schema.tables;
Let's see one first 5.7 Version database ;

And then look at 8.0 Version information ;
mysql> select distinct(ENGINE) from information_schema.tables;
+--------------------+
| ENGINE |
+--------------------+
| InnoDB |
| NULL |
| PERFORMANCE_SCHEMA |
| CSV |
+--------------------+
4 rows in set (0.01 sec)
mysql>
thus , In this paper, the end .
For more information, go to VX official account “ Operation and maintenance home ” , Get the latest article .
------ “ Operation and maintenance home ” ------
------ “ Operation and maintenance home ” ------
------ “ Operation and maintenance home ” ------
Interview with system operation and maintenance engineer , Nominations for excellent staff of operation and maintenance engineer ,tr O & M Engineer , I'm calling the operation and maintenance engineer for daily work ,IT Senior operation and maintenance engineer ;
Intelligent manufacturing operation and maintenance engineer training course , Remote office operation and maintenance engineer , Salary of Mindray medical operation and maintenance engineer , What does the backstage O & M engineer do ;
How about the wind operation and maintenance engineer , Inspur cloud operation and maintenance engineer , Sample certificate of medical equipment operation and maintenance engineer , Boyfriend of operation and maintenance engineer , The O & M engineer is grumpy .
边栏推荐
- RAID 磁盘阵列详解,RAID分类及优缺点
- C # from introduction to mastery Part II: C # basic grammar
- 虞美人·寄公度
- hicp第一天笔记
- 35岁以上的测试/开发程序员职业生涯走向,是职场转折点吗?
- Opencv tutorial 03: how to track an object in a video
- String correlation function (II)
- Acwing4405. 统计子矩阵
- Redis集群主备缓存区满了导致主备频繁倒换
- The active and standby cache of redis cluster is full, causing frequent active and standby switchover
猜你喜欢
随机推荐
二叉树2—对称性递归问题
Figure execution engine (II)
OpenCV基于DLCO描述子匹配
Understanding of rapid exploring random trees (RRT) path planning method
Day 1 Experiment
Machine learning Assignment 1
GET 请求和 POST 请求的区别和使用
一个技巧;教你轻松下载抖音直播视频,抖音直播视频下载新方案!
机器学习(上)吴恩达
Acwing786. The kth number
July training (day 17) - breadth first search
How to invest scientifically and rationally when the global financial crisis strikes? 2020-03-17
超声波传感器(CH101&ch201) - Ⅰ
Database daily question --- day 25: bank account summary II
Dynamic memory planning
数组去重 数组排序 最大值 求和 类数组转化 过滤数组
Ah Qu's thinking
水调歌头·明月几时有
我最喜欢的10个机器学习公众号
Learning record: call TFTLCD








