I. Introduction to database

1.Web Sources of data on Web pages

Graph TD Database --> Server --> Web Page

2. Database classification

① Non-relational database

A non-relational database is not strictly a database, but rather a collection of structured storage methods for data, either document or key-value equivalence.

Advantages:1, flexible format: the format of storage data can be key,value form, document form, picture form and so on, document form, picture form and so on, flexible use, wide application scenarios, and relational database only supports the basic type.2Fast speed: NoSQL can use hard disk or ram as a carrier, while relational databases can only use hard disk;3High scalability;4Low cost: NoSQL database is easy to deploy and is basically open source software.Copy the code
Disadvantages:1, does not provide SQL support, high cost of learning and using;2, no transaction processing;3, the data structure is relatively complex, complex query is a little short.Copy the code

③ Relational database

The most typical data structure of a relational database is a table, which is a data organization composed of two-dimensional tables and their connections.

Advantages:1, easy to maintain: are the use of table structure, consistent format;2Easy to use: SQL language universal, can be used for complex queries;3Complex operations: Supports SQL and can be used for very complex queries between one table and multiple tables.Copy the code
Disadvantages:1Poor read/write performance, especially efficient read/write of massive data;2Fixed table structure, flexibility slightly less;3, high concurrent read and write requirements, for traditional relational database, disk I/O is a big bottleneck.Copy the code

3. Introduction to MySQL database

MySQL is a relational database and one of the mainstream databases today. Especially in Web applications, MySQL is one of the best relational databases.

MySQL is a relational database management system. Relational databases keep data in different tables, rather than putting all data in a large warehouse, which increases speed and flexibility.

The SQL language used by MySQL is the most commonly used standardized language for accessing databases. MySQL software adopts the double licensing policy, which is divided into community edition and commercial edition. Due to its small size, fast speed and low total cost of ownership, especially the characteristics of open source, MySQL is generally selected as the website database for the development of small and medium-sized websites.

MySQL database installation

1. Download the MySQL installer from the official website

Website url: https://dev.mysql.com/downloads/installer/

2. Double-click the MSI file to install it.

3. Click Add

4. Select MySQL Server

5. Select version 8.0 and click the arrow to add it to the right

6. Click Next

7. Click on the Execute

8. Once installed, click Next

9. If you have installed another version of MySQL, the following message is displayed indicating that you need to change the port number.

10. Here I have changed it to 3307. Be sure to remember the changed port number. Click Next

11. Click Next

12. Set a password for the root user (top manager) and click Next

13. Set the service name, which is the service name of MySQL8.0 in the computer system. Click the Next button.

14. Click the Execute button. (I clicked it here)

15. Click Finish.

16. The installation is complete. Now let’s test if we can use it. Click on the bottom left corner of the Windows desktop to find the MySQL folder.

17. Click MySQL 8.0 Command Line Client

18. Enter the password of user root.

19. If the following dialog box is displayed, the installation is successful.