Home  >  Article  >  Database  >  what is mysql client

what is mysql client

藏色散人
藏色散人Original
2023-04-05 11:05:064271browse

mysql client refers to MySQL Client, which is a command line client; after installing MySQL, a MySQL Client program will be provided. Users can log in to MySQL through MySQL Client, then enter SQL statements and execute them That’s it.

what is mysql client

The operating environment of this tutorial: Windows 10 system, mysql8 version, Dell G3 computer.

What is mysql client?

After installing MySQL, in addition to MySQL Server, which is the real MySQL server, a MySQL Client program is also included. MySQL Client is a command line client. You can log in to MySQL through MySQL Client, and then enter and execute SQL statements.

Open the command prompt, enter the command mysql -u root -p, and prompt for a password. Fill in the MySQL root password. If it is correct, you will be connected to MySQL Server, and the prompt will change to mysql>:

┌────────────────────────────────────────────────────────┐
│Command Prompt                                    - □ x │
├────────────────────────────────────────────────────────┤
│Microsoft Windows [Version 10.0.0]                      │
│(c) 2015 Microsoft Corporation. All rights reserved.    │
│                                                        │
│C:\> mysql -u root -p                                   │
│Enter password: ******                                  │
│                                                        │
│Server version: 5.7                                     │
│Copyright (c) 2000, 2018, ...                           │
│Type 'help;' or '\h' for help.                          │
│                                                        │
│mysql>                                                  │
│                                                        │
└────────────────────────────────────────────────────────┘

Enter exit to disconnect from MySQL Server and return to the command prompt.

The executable program of MySQL Client is mysql, and the executable program of MySQL Server is mysqld.

The relationship between MySQL Client and MySQL Server is as follows:

┌──────────────┐  SQL   ┌──────────────┐
│ MySQL Client │───────>│ MySQL Server │
└──────────────┘  TCP   └──────────────┘

The SQL statement entered in MySQL Client is sent to MySQL Server through the TCP connection. The default port number is 3306, that is, if it is sent to the local MySQL Server, the address is 127.0.0.1:3306.

You can also just install MySQL Client and then connect to the remote MySQL Server. Assume that the IP address of the remote MySQL Server is 10.0.1.99, then use -h to specify the IP or domain name:

mysql -h 10.0.1.99 -u root -p

Summary

The command line program mysql is actually the MySQL client, the real MySQL The server program is mysqld, running in the background.

[Related recommendations: mysql video tutorial]

The above is the detailed content of what is mysql client. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:what is mysql sakilaNext article:what is mysql sakila