Table of contents
⛈️3. What are the advantages of MySQL
1. What is MySQL
MySQL is an open source relational database management system (RDBMS) that uses Structured Query Language (SQL) for data management. MySQL was developed by MySQL AB of Sweden and is now owned by Oracle Corporation.
MySQL is widely used for backend data storage and management of web applications. It has good performance, stability and reliability, and can handle large amounts of data and concurrent requests. MySQL supports multiple operating systems, and has many programming language APIs, which can be easily integrated into various applications
2. Why use MySQL
Open source and free: MySQL is an open source software and is free to use under a license, which means you don't need to pay high licensing fees. This is very attractive for individual developers, start-ups, and projects with limited budgets.
High Performance and Scalability: MySQL is designed as a high performance database management system. It can handle large-scale data and high concurrent access, and is suitable for applications that need to process large amounts of data. At the same time, MySQL also provides a variety of scalability options, including master-slave replication, partitioning, and clustering, which can easily expand database performance and capacity according to needs.
Ease of use: MySQL has a simple, intuitive command-line interface and management tools that are easy to install and configure. It also provides a wealth of development tools and APIs, which can be easily integrated with various programming languages, simplifying the development work.
Large community support: MySQL is one of the very popular database management systems with a large community of users and developers worldwide. This means you can get support from the community, solve problems, get advice and share experiences.
Cross-platform compatibility: MySQL can run on a variety of operating systems, including Windows, Linux, macOS, and more. It is also compatible with other database systems and applications for easy data migration and integration.
Security and stability: MySQL provides a variety of security functions, including user authentication, authority management, data encryption, etc., which can protect the security and integrity of data. It has also been developed and tested for a long time, with high stability and reliability
3. What are the advantages of MySQL
Reliability and Stability: MySQL has been extensively tested and used, and has demonstrated its stability and reliability in many large-scale applications. It has transaction support and ACID (atomicity, consistency, isolation, durability) characteristics, which can ensure the integrity and consistency of data.
Scalability: MySQL has good scalability and can easily handle large amounts of data and high concurrent access. It supports technologies such as master-slave replication, distributed architecture, and sharding, enabling horizontal and vertical expansion of data.
Performance optimization: MySQL improves performance in a variety of ways, including support for indexes, query optimizers, and caching mechanisms. It also provides a variety of storage engines, such as InnoDB, MyISAM, etc., and the most suitable storage engine can be selected according to the needs of the application.
Flexibility: MySQL supports multiple programming languages and development frameworks, and can be seamlessly integrated with various applications. At the same time, it also provides a wealth of functions and tools to meet different types of data processing needs, such as data analysis, report generation, etc.
Cost-effectiveness: As an open source software, MySQL is relatively inexpensive to use and maintain. It runs on a variety of operating systems and is backed by a large developer community with extensive documentation, tutorials, and technical support.
MySQL has the advantages of high performance, scalability, ease of use, security and data integrity. It is widely used in applications of all sizes and types, from personal projects to large enterprise solutions.
4. Official website:
http://www.mysql.com/
5. Download
5.1: find DOWNLOADS
5.2: Find the MySQL Community Edition
5.3: Select Downloads Archives
5.4: Click MySQL Community Server
5.5: Choose according to your server configuration
Six. Installation
First create a directory
[root@localhost ~]# cd /mysql/
[root@localhost mysql]# rz
ZMODEM Session started
------------------------
37% mysql-8.0.32-1.el7.x86_64.rpm-bundle.tar
decompress
[root@localhost mysql]# ls
mysql-8.0.32-1.el7.x86_64.rpm-bundle.tar
[root@localhost mysql]# tar xf mysql-8.0.32-1.el7.x86_64.rpm-bundle.tar
[root@localhost mysql]# ls
mysql-8.0.32-1.el7.x86_64.rpm-bundle.tar mysql-community-devel-8.0.32-1.el7.x86_64.rpm mysql-community-server-8.0.32-1.el7.x86_64.rpm
mysql-community-client-8.0.32-1.el7.x86_64.rpm mysql-community-embedded-compat-8.0.32-1.el7.x86_64.rpm mysql-community-server-debug-8.0.32-1.el7.x86_64.rpm
mysql-community-client-plugins-8.0.32-1.el7.x86_64.rpm mysql-community-icu-data-files-8.0.32-1.el7.x86_64.rpm mysql-community-test-8.0.32-1.el7.x86_64.rpm
mysql-community-common-8.0.32-1.el7.x86_64.rpm mysql-community-libs-8.0.32-1.el7.x86_64.rpm
mysql-community-debuginfo-8.0.32-1.el7.x86_64.rpm mysql-community-libs-compat-8.0.32-1.el7.x86_64.rpm
[root@localhost mysql]#
Install a plugin ( dependency )
[root@localhost mysql]# yum install openssl-devel
rpm starts to install in sequence
[root@localhost mysql]# rpm -ivh mysql-community-common-8.0.32-1.el7.x86_64.rpm
警告:mysql-community-common-8.0.32-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-common-8.0.32-1.e################################# [100%]
[root@localhost mysql]# rpm -ivh mysql-community-client-plugins-8.0.32-1.el7.x86_64.rpm
警告:mysql-community-client-plugins-8.0.32-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-client-plugins-8.################################# [100%]
[root@localhost mysql]# rpm -ivh mysql-community-libs-8.0.32-1.el7.x86_64.rpm
警告:mysql-community-libs-8.0.32-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-libs-8.0.32-1.el7################################# [100%]
[root@localhost mysql]# rpm -ivh mysql-community-libs-compat-8.0.32-1.el7.x86_64.rpm
警告:mysql-community-libs-compat-8.0.32-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-libs-compat-8.0.3################################# [100%]
[root@localhost mysql]# rpm -ivh mysql-community-devel-8.0.32-1.el7.x86_64.rpm
警告:mysql-community-devel-8.0.32-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-devel-8.0.32-1.el################################# [100%]
[root@localhost mysql]# rpm -ivh mysql-community-client-8.0.32-1.el7.x86_64.rpm
警告:mysql-community-client-8.0.32-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-client-8.0.32-1.e################################# [100%]
[root@localhost mysql]# rpm -ivh mysql-community-icu-data-files-8.0.32-1.el7.x86_64.rpm
警告:mysql-community-icu-data-files-8.0.32-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-icu-data-files-8.################################# [100%]
[root@localhost mysql]# rpm -ivh mysql-community-server-8.0.32-1.el7.x86_64.rpm
警告:mysql-community-server-8.0.32-1.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 3a79bd29: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-server-8.0.32-1.e################################# [100%]
Seven. View
[root@localhost mysql]# systemctl start mysqld 启动 MySQL
[root@localhost mysql]# systemctl status mysqld 查看MySQL
[root@localhost mysql]# systemctl stop mysqld close MyS
[root@localhost mysql]# systemctl start mysqld
[root@localhost mysql]# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since 四 2023-07-06 17:53:28 CST; 5s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 8818 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 8889 (mysqld)
Status: "Server is operational"
Tasks: 39
CGroup: /system.slice/mysqld.service
└─8889 /usr/sbin/mysqld
7月 06 17:53:22 localhost.localdomain systemd[1]: Starting MySQL Server...
7月 06 17:53:28 localhost.localdomain systemd[1]: Started MySQL Server.
8. Modify password
8.1: Find the MySQL initial password
cat /var/log/mysqld.log
8.2: Enter MySQL
mysql -uroot -p initial password
8.3: Modify MySQL (must meet the complexity)
ALTER USER 'root'@'localhost' IDENTIFIED BY '123.com.CN';
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123.com.CN';
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
[root@localhost ~]# mysql -uroot -p123.com.CN
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 8.0.32 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>