[MySQL] Take you to understand MySQL & how to learn MySQL and the purpose and significance of MySQL

        

Table of contents

 1 The origin and development of MySQL

1.0.1 Database Management System

 1.1 The origin of MySQL

Origin of naming:

1.2 The development history of MySQL

2 What is MySQL?

2.1 Database

2.1.1 The format in which we stored data before:

2.1.2 The purpose of using the database:

2.1.3 Database Classification

2.2 SQL statement

2.2.1 Why SQL statements

2.2.2 SQL statement classification 

3 How to learn MySQL

3.1 knowledge system of mysql

3.2 Some recommended videos & books

3.3 Features of MySQL


        Speaking of MySQL, most of us who have relevant or slight connections with this industry know this "thing". You may not know what MySQL is, or you may know something about it as a database management system, but you may I don't really know what is MySQL, why there are so many similar products, most of us say to learn MySQL instead of other systems. When we are studying, we must know what it is and why it is. We cannot say: ah, I want to learn MySQL! After that, we will find the MySQL explanation course and start learning sentences directly. In this way, you can indeed learn to operate MySQL, but do you know the significance of your learning it? So, before we start learning, we must learn about MySQL, understand its purpose, and its functions. In this case, will we have a clear correspondence to the knowledge we have learned in the later study? Once I know it, there will be no such rhetoric about why I learned from him!

 1 The origin and development of MySQL

         MySQL (pronounced "my ess cue el") is an open source relational database management system developed by the Swedish company MySQL AB.

1.0.1 Database Management System

        The abbreviation of the database management system is "DBMS", and the full English name is "Database Management System". It is a large-scale software for manipulating and managing databases, and is used to create, use and maintain databases. It performs unified management and control on the database to ensure the security and integrity of the database. Users access the data in the database through the database management system (DBMS), and the database administrator also maintains the database through the database management system (DBMS). And the MySQL we are talking about today is also one of the database management software.

 1.1 The origin of MySQL

         The history of the MySQL database can be traced back to 1979, when Bill Gates dropped out of school not long ago, Microsoft was just getting started, and Larry Ellison's Oracle was just established. At that time, a talented programmer, Monty Widenius, worked for a small company called TcX, and designed a reporting tool in BASIC so that it could run on a computer with a main frequency of 4MHz and 16KB of memory. Not long after, Monty rewrote the tool in C and ported it to the UNIX platform. At that time, this was just a very low-level and report-oriented storage engine called UNIREG. The original UNIREG ran on the ABC800 computer made by the Swedish. The memory of ABC800 is only 32KB, and the CPU is Z80 with a frequency of only 4MHz. In 1983, Monty Widenius met David Axmark. The two met each other late and began to cooperate to operate TcX. Monty Widenius was in charge of technology, and David Axmark was in charge of management. Later, TcX ported UNIREG to other more powerful hardware platforms, mainly Sun's platform. Although TcX is a small company with limited resources, Monty Widenius is extremely talented. Faced with the disadvantages of limited resources, he is better able to realize his potential. Monty Widenius has always strived to write the most efficient code, and thus developed a habit. There were some other colleagues with Monty Widenius, and few people could persist in writing that code for 20 years, but Monty Widenius did it.

  In 1990, Monty received a project. The customer needed to provide a more general SQL interface for UNIREG at that time. At that time, someone proposed to use a commercial database directly, but Monty Widenius felt that the speed of the commercial database was not satisfactory. So Monty Widenius approached David Hughes (the inventor of mSQL) to discuss cooperation. I want to integrate it into my own storage engine with the help of mSQL code. However, it was disappointing that after some testing, they found that the speed of mSQL was not satisfactory and could not meet the needs of customers. So Monty Widenius became ambitious and decided to rewrite a SQL support by himself. Since then, MySQL has been born.

Origin of naming:

        Monty Widenius has a daughter named My Widenius, so he named the database he developed MySQL. Monty also has a son named Max, so after SAP established a partnership with MySQL in 2003, Monty Widenius named the database jointly developed with SAP MaxDB. And now Maria in MariaDB is the name of the little granddaughter of Monty Widenius.

1.2 The development history of MySQL

  • In 1990, some of TcX's customers began to request SQL support for his API. Monty integrated it into his own storage engine directly with the help of mSQL code. Disappointingly, the effect was not too satisfactory, determined to rewrite a SQL support by myself. 
  • In 1995, Michael Widenius, David Axmark and Allan Larsson founded MySQL AB and released the first version of MySQL.
  • In 1996, MySQL released the first commercially available version and began to be widely used in the commercial field.
  • In 2000, MySQL 3.23 was released, which introduced functions such as B-tree index, which improved query efficiency and stability.
  • In 2003, MySQL 4.0 was released, introducing functions such as transaction processing and views, and transitioning MySQL from a lightweight database to an enterprise-level database.
  • In 2005, MySQL 5.0 was released, which introduced functions such as stored procedures, triggers, and view updates, which further improved the performance and scalability of MySQL.
  • In 2008, Sun Microsystems acquired MySQL AB, and MySQL became an important part of Sun.
  • In 2010, Oracle Corporation acquired Sun Microsystems, and MySQL became one of Oracle's products.
  • In December 2010, MySQL 5.5 was released. Its main new features include semi-synchronous replication and support for SIGNAL/RESIGNAL exception handling functions. The most important thing is that the InnoDB storage engine has finally become the current MySQL default storage engine. MySQL 5.5 is not a simple version update after two years, but strengthens the enterprise-level features of all aspects of MySQL. Oracle also promises that MySQL 5.5 and future versions will still be open source products authorized by the GPL.
  • In 2013, Michael Widenius, founder of the MariaDB project, announced his departure from Oracle, created his own company and launched a MySQL-based branch, MariaDB.
  • In 2014, MySQL 5.7 was released, which introduced functions such as JSON support, online DDL, and spatial indexing, and continued to enhance the functions and performance of MySQL.

At present, MySQL has become one of the most popular relational databases in the world, widely used in Web applications, enterprise information systems and other fields. MySQL is also one of the database systems adopted by many well-known companies and organizations (such as Google, Facebook, Twitter, etc.).

2 What is MySQL?

        MySQL is a secure, cross-platform, efficient database system that is closely integrated with mainstream programming languages ​​such as PHP and Java. The database system is developed, released and supported by the Swedish company MySQL AB, established in 1995 by the original MySQL developers David Axmark and Michael Monty Widenius. The symbol for MySQL is a dolphin named Sakila, which represents the speed, power, precision and excellence of the MySQL database.

        That is to say, it is a large-scale software for manipulating and managing databases, and the language used is SQL statements. That is to use SQL statements to manipulate and manage the database in MySQL.

2.1 Database

        A database is an organized collection of data consisting of a series of related tables, fields, records, and other data objects. Databases are usually used to store and manage large amounts of data, and provide operations such as query, update, and delete.

A database usually consists of one or more tables. Each table is made up of columns and rows. The columns define the data types and names in the table, and the rows represent the actual data entries. For example, in a user information database, there may be a table representing user information, which may contain columns such as name, gender, age, phone number, etc., and each row corresponds to a specific user.

In addition to tables, databases can also include objects such as indexes, views, triggers, and stored procedures, which can help us access and manage data in the database more quickly and conveniently.

Databases can be widely used in various fields, such as web applications, enterprise information systems, Internet of Things systems, etc. In these application scenarios, databases can not only help us store large amounts of data, but also provide us with valuable information through data analysis and data mining.

2.1.1 The format in which we stored data before:

我们在存储数据都经历的那些阶段:

#  1.文件操作阶段(用文件充当数据库 with open(python))
	jason|123|read
	jason&123&read
    jason*123*read
'''这个阶段每个人在存储数据的时候格式都不同 程序之间无法兼容'''
    
    
#  2、软件开发目录规范
	db目录下  : 数据存储文件
'''虽然存储的目录规范了,但是每个人存储的数据格式还都不相同 程序之间也无法兼容'''


#  3、数据库阶段
'''规定了文件的存储位置和数据格式,这样就解决了数据无法兼容的问题。解决了各方面的问题。'''

2.1.2 The purpose of using the database:

   使用数据库的目的就是为了解决数据不兼容的问题,基于网络使数据在某一个地方以相同的格式统一做一个保存,实现数据共享

2.1.3 Database Classification

Relational Database

It has a fixed table structure, and the relationship between tables can be established through foreign keys.
A relational database refers to a database that uses a relational model to organize data. Simply put, the relational model refers to the two-dimensional table model, and a relational database is a data organization composed of two-dimensional tables and the connections between them.

It can be seen as an excel form: there are several fixed fields, and the following is the data.

Disadvantages: Performance is not as good as non-relational databases Advantages: Data statistics are rigorous

What are relational databases:

1、MySQL
MariaDB  	:和MySQL是同一个作者开发几乎一致(并且有自己的特性),但是开源免费
Oracle		:大多数银行使用
PostgreSQL  :支持二次开发
sqlserver	
sqlite  	: django框架自带该数据库
db2 .....

non-relational database

There is no fixed table structure, and data storage adopts k:v key-value pair {k:v} unstructured storage.

What are non-relational databases?

常用的非关系型数据库:
1、redis   :目前最火的缓存数据库 具有很多数据结构,功能强大(大部分公司使用)
2、mongoDB :文档型数据库,适用于敏捷开发(应用在爬虫和大数据领域)
3、memcache :几乎已经被redis淘汰。

2.2 SQL statement

        SQL (Structured Query Language) is a language for managing relational databases. An SQL statement refers to a command or query written in the SQL language for operating a database. SQL statements can be used to create, read, update and delete data in the database.

2.2.1 Why SQL statements

        Because the database can support many languages, in order to avoid identification problems, SQL statements were invented. It stipulates that as long as you want to use the database, you can use SQL statement operations uniformly to solve the language incompatibility caused by operating databases in different languages, and to achieve data compatibility.

2.2.2 SQL statement classification 

  1. Database operation statements: used to create, modify and delete databases and their objects, such as CREATE DATABASE, ALTER DATABASE and DROP DATABASE, etc.

  2. Table operation statement: used to create, modify and delete tables and their structures, such as CREATE TABLE, ALTER TABLE and DROP TABLE, etc.

  3. Data manipulation statements: used to insert, query, update, and delete data in tables, such as SELECT, INSERT, UPDATE, and DELETE.

  4. Index operation statement: used to create, modify and delete indexes on the table, such as CREATE INDEX, ALTER INDEX and DROP INDEX, etc.

  5. View operation statement: used to create, modify and delete views, such as CREATE VIEW, ALTER VIEW and DROP VIEW, etc.

  6. Stored procedures and triggers: used to define stored procedures and triggers, such as CREATE PROCEDURE, ALTER PROCEDURE and DROP PROCEDURE, etc.

        Of course, SQL statements are a common language that can run on various relational database management systems (such as MySQL, Oracle, SQL Server, PostgreSQL, etc.). Mastering SQL statements can effectively manage and query databases, which is very important for Web application development and data analysis and other fields.

3 How to learn MySQL

Since you want to learn MySQL, how should you learn it? this is a problem.

How to learn and learn a technology well, there are many different methods for many people, you can go to the Internet to find related videos, you can also search for related blogs that seem to be missing, or even go to some open source projects Learn and practice. The same is true for MySQL. This "guy" is also very large and has a wide range of uses. It is not easy to learn and master the system.

In fact, it can be roughly divided into the following three steps to master:

Basic application stage : In this stage, you need to learn the theoretical knowledge of MySQL, such as: commonly used data types and applicable scenarios, Schema design specifications, etc. After that, use theory to guide practice, simply use MySQL, and be able to understand basic additions, deletions, modifications, queries, aggregation and grouping concepts, and so on. At the same time, it is also required to be able to solve some simple problems by itself, such as: SQL syntax errors, key conflicts, and so on.

Ability improvement stage : After proficiency in the application, you can look at some advanced knowledge points and advanced features of MySQL, such as: transactions, lock concurrency, log system, index optimization, etc. It sounds like this stage is all about theory. However, it is also the best interpretation of theory guiding practice. In the process of learning the theory, you will be surprised to find: it turns out that MySQL can still be used in this way, my previous method is too inefficient, and other unexpected gains. At this point, you can use "new knowledge" to optimize and refactor your previous work to improve performance. At the same time, your ability is gradually improving.

Summary output stage : In the work, while solving various errors and performance problems, we must pay attention to taking more notes and making more summaries. And in this process, output the knowledge points, skills, optimization plans, etc. that you know to help other students make progress together. As the saying goes, giving someone a rose will leave a lingering fragrance in your hand.

3.1 knowledge system of mysql

Base:

  • SQL statement
  • table structure design

Tuning:

  • Index, slow query optimization
  • Configuration parameter tuning

Core principle:

  • InnoDb storage engine (including isolation level, transaction, lock, cache pool, rollback log, etc.)
  • Mysqld (including connection management, process management, query cache, query optimization, logging, etc.)

Architecture and O&M:

  • Users and permissions, security
  • backup and restore
  • log
  • Distributed and highly available

3.2 Some recommended videos & books

You can find some bloggers you like in CSDN, and follow their columns to learn related knowledge. Here I recommend some books and online courses for you.

"MySQL must know and know" This book is very comprehensive, from basic concepts, to querying to inserting new tables, user management, there are specific examples, very suitable for students who do not have any foundation to learn Mysql, in short, this book The method of book learning is: 1. Understand the basic concepts of the database in ten minutes 2. Find the database for practice 3. Type against the above content. There is also a lot of content in this book about sql, which can be read in combination with w3c sql tutorials.

The book "Database System Concepts" is a must-read for DBAs. After reading these and practicing + thinking, you can count as an introduction.

As for online courses, I recommend to you the free online courses offered by dark horse programmers (I don’t recommend paying for them)

 Dark horse programmers from beginners to proficient in MySQL database, from mysql installation to mysql advanced, mysql optimization all covered_哔哩哔哩_bilibili

Of course, if you have any good resource recommendations, you can also post them in the comment area.

3.3 Features of MySQL

The features of MySQL are as follows:

-Powerful

MySQL provides a variety of database storage engines. Each engine has its own strengths and is suitable for different applications. Users can choose the most suitable engine to obtain the highest performance, and can handle high-intensity search Web with more than hundreds of millions of daily visits. site. MySQL5 supports transactions, views, stored procedures, triggers, etc.

—Support cross-platform

MySQL supports at least 20 development platforms, including Linux, Windows, FreeBSD, IBMAIX, AIX, FreeBSD, etc. This allows programs written on any platform to be transplanted without any modification to the program.

- run fast

High speed is a notable feature of MySQL. In MySQL, extremely fast B-tree disk table (MyISAM) and index compression are used; by using optimized single-scan multiple connections, connections can be realized extremely fast; SQL functions are implemented using highly optimized class libraries and run extremely fast .

—Support object-oriented

PHP supports a hybrid programming style. Programming methods can be divided into purely object-oriented, purely process-oriented, and mixed object-oriented and process-oriented methods.

— High security

Flexible and secure permissions and password system, allowing authentication of basic hosts. When connecting to the server, all password transmissions are encrypted to ensure password security.

-low cost

The MySQL database is a completely free product that users can download directly from the Internet.

—Support various development languages

MySQL provides support for various popular programming languages ​​and provides them with many API functions, including PHP, ASP.NET, Java, Eiffel, Python, Ruby, Tcl, C, C++, Perl, etc.

— Large database storage capacity

The maximum effective table size for a MySQL database is usually determined by operating system limits on file sizes, not by MySQL internal limits. The InnoDB storage engine stores InnoDB tables in a table space, which can be created from several files. The maximum capacity of the table space is 64TB, which can easily handle large databases with tens of millions of records.

—Support powerful built-in functions

A large number of built-in functions are provided in PHP, covering almost all functions in web application development. It has built-in functions such as database connection and file upload, and MySQL supports a large number of extended libraries, such as MySQLi, which can facilitate the rapid development of Web applications.

Guess you like

Origin blog.csdn.net/qq_62464995/article/details/130337814