MySQL Connection mode

Source: Internet
Author: User

MySQL connection Mode 1:TCP/IP Socket mode This approach establishes a network-based connection request on a TCP/IP connection, typically a client connection to a MySQL instance running on the server, and 2 machines connected via a TCP/IP network. C:\users\gechong>mysql-h192.168.1.10-uroot-p
Enter Password: *******
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is6
Server version:5.5. --log MySQL Community Server (GPL)

Copyright (c) -, ., Oracle and/or its affiliates. All rights reserved.

Oracle isA registered trademark of Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.

Type'Help ;'Or'\h' forHelp. Type'\c'To clear the current input statement.

Mysql> the client here is windows, which initiates a TCP/IP request to the MySQL instance on the IP-192.168.1.10 server, and MySQL is available after the connection is successful. You can view:mysql> SELECT User,host,password from Mysql.user \g
***************************1. Row ***************************
User:root
Host:localhost
Password: *11b9aca21786f766739d0eb1483c5f64212b81ac
***************************2. Row ***************************
User:root
Host127.0.0.1
Password: *11b9aca21786f766739d0eb1483c5f64212b81ac
***************************3. Row ***************************
User:gechong
Host:localhost
Password: *7ae39be5035d5c32361400ff7dedd757aa76896a
3RowsinchSet(0.02SEC) This permission table clearly shows which users MySQL is allowed to connect in which IP segments 2:unix domain sockets UNIX domain sockets are not network protocols, so they can only be used on a single server for MySQL clients and DB instances. The user can specify a socket file in the configuration file--socket=/tmp/mysql.sock
Mysql> SHOW VARIABLES like'Socket';
+---------------+-----------------+
| variable_name | Value |
+---------------+-----------------+
| sockets | /tmp/mysql.sock |
+---------------+-----------------+
1RowinchSet(0.00Sec

#Mysql-uroot-s/tmp/mysql.sock



MySQL Connection mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.