Mysql installation detailed tutorial

 Database related concepts

The current market shares of mainstream relational database management systems are ranked as follows:

Oracle: A large fee-based database, a product of Oracle, is expensive.

MySQL: An open source and free small and medium-sized database. Later, Sun acquired MySQL, and Oracle acquired Sun. At present, Oracle has launched 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 languages ​​such as C# and .net.

PostgreSQL: Open source free small and medium database.

DB2: IBM's large-scale fee-based database product.

SQLLite: Embedded micro-database. The built-in database of Android uses this database.

MariaDB: Open source free small and medium database. It is another branch of the MySQL database, another derivative product, and has good compatibility with the MySQL database.

 And no matter which relational database we use above, we will use the SQL language to perform unified operations in the final operation, because the SQL language we mentioned earlier is a unified standard for operating relational databases. So even if we are learning MySQL now, if we go to the company in the future and use other relational databases, such as: Oracle, DB2, SQLServer, there is no need to worry at all, because the operation methods are the same.

MySQL database installation 

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

MySQL officially provides two different versions: The community version (MySQL Community Server) is free, MySQL does not provide any technical support The commercial version (MySQL Enterprise Edition) is charged, can be used for 30 days, and officially provides technical support

This article uses the community version of MySQL-MySQL Community Server 8.0.26

MYSQL download 

Download address: https://downloads.mysql.com/archives/installer/

Install

To use MySQL, we must first install MySQL. We can complete the MySQL installation step by step according to the following steps.

1). Double-click the official installation package file

 

2). Follow the installation prompts to install 

 

 

Install the related components of MySQL, this process may take a few minutes, wait patiently.

 

 

 

 

Enter the password of the root user in MySQL, be sure to remember the password 

 

 

 

Mysql configuration

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

A. On this computer, right click and select Properties

B. Click "Advanced System Settings" on the left and select Environment Variables

 

C. Find the Path system variable, click "Edit"

 

D. Select "New" and add the bin directory under the MySQL Server installation directory to the environment variable 

 

Mysql start stop

After the MySQL installation is complete, the MySQL service will be automatically started when the system starts, so we don't need to start it manually.

Of course, you can also manually start and stop through commands, run cmd as an administrator, and enter the command line to execute the following commands:

net start mysql80
net stop mysql80

 Note: The above mysql80 is the system service name of mysql specified by default when we installed MySQL. It is not fixed. If it is not changed, the default is mysql80

 

 

client connection

1). Method 1: Use the client command line tool provided by MySQL

 

2). Method 2: Use the command line tool that comes with the system to execute the command

mysql [-h 127.0.0.1] [-P 3306] -u root -p

参数:

 -h : MySQL服务所在的主机IP
 -P : MySQL服务端口号, 默认3306
 -u : MySQL数据库用户名

 -p : MySQL数据库用户名对应的密码

 [] are optional parameters. If you need to connect to remote MySQL, you need to add these two parameters to specify the remote host IP and port. If you want to connect to local MySQL, you don’t need to specify these two parameters.

Note: When using this method to connect, you need to configure the PATH environment variable after the installation is complete. 

 

 

Guess you like

Origin blog.csdn.net/weixin_45934981/article/details/130258877