Let's learn about MySQL database

Let's learn about MySQL database

1. What is a database?

A database is a type of software that manages data. Data management is reflected in two aspects: the first is to describe data, that is, how to represent a piece of data; the second is to organize data, that is, how to manage a lot of data.

The main purpose of the database is to add, delete, modify and query data.

2. Classification of databases?

數據庫主要分為關系型數據庫和分關系型數據庫。

Relational Database Non-relational database
Data requirements Data standardization No requirement for unified data standards
How to organize data surface Document/Key-Value Pair
How to organize

Put similar data into one table

Each row in the table is a record

Each record contains many columns, and the types and meanings of these columns must be consistent.

Each record is a document, and the attributes and fields in each document are not required to be the same.
advantage More stringent data verification It is less strict on data verification, but more efficient and more suitable for current distributed systems.
Typical Representatives Oracle, MySQL, SQL Server MangoDB, Redis, HBase

3. The difference between database and data structure

Data structure: It is an abstract subject that studies the logical structure and physical structure of data and their interrelationships, defines operations that are appropriate for this structure, and designs corresponding algorithms.

Database: It is a more specific type of software, and many data structures are used in the process of implementing this software.

Many software require data structures to implement additions, deletions, modifications and queries, and databases are just one of the application scenarios.

4. Introduction to MySQL database

4.1 Composition of MySQL Database

MySQL database is a "client-server" program. The client is the party that actively initiates the request. The data sent by the client is called a request. The server is the party that passively accepts the request. The data returned by the server is called a response. The client and server communicate through the network.

When installing the MySQL database, you can install the client and server on the same host or on different hosts. In actual situations, the same server can provide services to multiple clients.

MySQL Client It is a very simple program that is only used to interact with the user. (Database programming refers to the implementation of a client and has nothing to do with the server)
MySQL Server It is the body of the database. The MySQL database stores data on the server.

Mainstream MySQL versions: MySQL 5 series, MySQL 8 series.

4.2 Introduction to MySQL Server

The MySQL server contains several databases, each of which is a logical collection of data tables (putting related tables together).

Server: contains multiple databases

Database: contains multiple tables

Table: contains multiple rows, each row is a record

Row: contains multiple columns, each column is a field

4.3 Data storage location of MySQL database

Many databases store data in external memory, such as MySQL and Oracle, while a few databases store data in memory, such as Redis.

MySQL stores data on disk. Here are the reasons:

First, understand the difference between memory and hard disk:

The memory has less space, while the hard disk has more space; the memory is more expensive than the hard disk; if there is a power outage, the data in the memory will be lost, but the data on the hard disk will not be lost.

The requirements for storing data in the database are: large capacity because the amount of data is large; lower costs are expected; data is expected not to be lost after power failure and can be stored persistently; compared with memory, hard disks fully meet these requirements, so hard disks are chosen to store data.

If the amount of stored data is large, you can choose to use the following method:

①Add more hard disks

② Use multiple machines for storage and shard MySQL databases and tables.

Summarize

First, the classification of databases is introduced, which are divided into structured databases and unstructured databases. Secondly, the composition of MySQL database is introduced, that is, MySQL consists of client and server, and the server is the main body of MySQL. Finally, it is introduced that the MySQL server stores data on the hard disk because the hard disk has large capacity, is cheap and can achieve persistent storage.

This is the end of this article about understanding MySQL database. For more relevant MySQL database content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of MySQL database index
  • MySQL Database Indexes and Transactions
  • MySQL database aggregate query and union query operations

<<:  The marquee tag in HTML achieves seamless scrolling marquee effect

>>:  Detailed explanation of CSS text decoration text-decoration &amp; text-emphasis

Recommend

Implementation steps of Mysql merge results and horizontal splicing fields

Preface Recently, I was working on a report funct...

Solve the problem that the IP address obtained using nginx is 127.0.0.1

Get ip tool import lombok.extern.slf4j.Slf4j; imp...

Meta declaration annotation steps

Meta declaration annotation steps: 1. Sort out all...

Detailed explanation of how to use grep to obtain MySQL error log information

To facilitate the maintenance of MySQL, a script ...

How to use nodejs to write a data table entity class generation tool for C#

Although Microsoft provides T4 templates, I find ...

How to operate MySql database with gorm

1. Setting case sensitivity of fields in the tabl...

MySql inserts data successfully but reports [Err] 1055 error solution

1. Question: I have been doing insert operations ...

How to understand Vue's simple state management store mode

Table of contents Overview 1. Define store.js 2. ...

MySQL 8.0.12 installation and configuration method graphic tutorial (windows10)

This article records the installation graphic tut...

Detailed explanation of three methods of JS interception string

JS provides three methods for intercepting string...

Detailed explanation of the relationship between Linux and GNU systems

Table of contents What is the Linux system that w...

How to get the size of a Linux system directory using the du command

Anyone who has used the Linux system should know ...

Steps to repair grub.cfg file corruption in Linux system

Table of contents 1. Introduction to grub.cfg fil...

Solve the problem of the container showing Exited (0) after docker run

I made a Dockerfile for openresty on centos7 and ...

How to use VUE to call Ali Iconfont library online

Preface Many years ago, I was a newbie on the ser...