what is mysql client

藏色散人
Release: 2023-04-05 11:05:06
Original
4169 people have browsed it

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> │ │ │ └────────────────────────────────────────────────────────┘
Copy after login

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 └──────────────┘
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!