MySQL database--getting started

1. MySQL Overview

1.1 Database related concepts

Three concepts: database, database management system, and SQL.
Insert image description here
The current market share rankings of mainstream relational database management systems are as follows:

  • Oracle: A large paid database, an Oracle product, is expensive.
  • MySQL: an open source free small and medium-sized database. Later, Sun acquired MySQL, and Oracle acquired Sun.
    Oracle currently launches a paid version of MySQL and also provides a free community version.
  • SQL Server: A fee-based medium-sized database launched by Microsoft, commonly used in C#, .net and other languages.
  • PostgreSQL: open source and free small and medium-sized database.
  • DB2: IBM's large-scale paid database product.
  • SQLLite: an embedded micro-database. Android's built-in database uses this database.
  • MariaDB: open source and free small and medium-sized database. It is another branch of the MySQL database and another derivative product.
    It has good compatibility with the MySQL database.

No matter which of the above relational databases we are using, in the end, we will use SQL language for unified operations,
because we talked about SQL language earlier, which operates relational databases.Uniform standards.

1.2 MySQL database

Version 1.2.1

Official: https://www.mysql.com/

MySQL officially provides two different versions:

  • The community version (MySQL Community Server)
    is free, and MySQL does not provide any technical support.
  • The commercial version (MySQL Enterprise Edition)
    is charged and can be used for 30 days. Official technical support is provided

1.2.2 Download

Download address: https://downloads.mysql.com/archives/installer/After
Insert image description here
that, you can complete the installation by performing a series of next steps.

1.2.3 Configuration

After installing MySQL, you also need to configure environment variables so that you can connect to MySQL in any directory.

  • On this computer, right-click and select Properties
    Insert image description here
  • Click "Advanced System Settings" on the left and select Environment Variables
    Insert image description here
  • Find the Path system variable and click "Edit"
    Insert image description here
  • Select "New" and add the bin directory under the MySQL Server installation directory to the environment variable
    Insert image description here

1.2.4 Start and stop

After the MySQL installation is completed, the MySQL service will be automatically started when the system starts, and we do not need to start it manually.
Of course, you can also manually start and stop through commands, run cmd as an administrator, enter the command line and execute the following commands:

net start mysql80
net stop mysql80

Insert image description here

1.2.5 Client connection

Use the client command line tool provided by MySQL
Insert image description here

1.2.6 Data model

1. Relational database (RDBMS)
Concept: A database based on a relational model and composed of multiple interconnected two-dimensional tables.

The so-called two-dimensional table refers to a table composed of rows and columns, as shown below (similar to Excel table data, with headers, columns, and rows, and one column can also be associated with a certain column of data in another table ). The MySQL, Oracle, DB2, and SQLServer we mentioned before are all relational databases, which store data based on two-dimensional tables. Simply put, a database that stores data based on two-dimensional tables becomes a relational database, and a database that stores data based on two-dimensional tables is a non-relational database.
Insert image description here
Features:
A. Use tables to store data with a unified format and easy maintenance.
B. Use SQL language operation, unified standards and easy to use.

2. Data model
MySQL is a relational database that stores data based on two-dimensional tables. The specific structure diagram is as follows:
Insert image description here

  • We can connect to the database management system DBMS through the MySQL client, and then operate the database through the DBMS.
  • You can use SQL statements to operate the database through the database management system, as well as operate the table structure and data in the database.
  • Multiple databases can be created in one database server, one database can also contain multiple tables, and one table can contain
    multiple rows of records.

Supongo que te gusta

Origin blog.csdn.net/m0_63260018/article/details/133177100
Recomendado
Clasificación