当前位置:网站首页>mysql. What is the concept of sock
mysql. What is the concept of sock
2022-06-29 17:23:00 【Yisu cloud】
mysql.sock What is the concept of
This article mainly explains “mysql.sock What is the concept of ”, The explanation in the text is simple and clear , Easy to learn and understand , Next, please follow Xiaobian's ideas and go deeper slowly , Study and learn together “mysql.sock What is the concept of ” Well !
“mysql.sock” yes mysql Socket file for , yes mysql The host and client of are in the same host Last time , Use unix socket As the carrier of communication protocol . stay UNIX Local connection under series system MySQL May adopt TCP The connection and UNIX There are two methods of domain socket ; among UNIX Domain socket mode requires a socket file , You can use “show variables like 'socket'\G;” Command to view local socket file location .
The operating environment of this tutorial :linux7.3 System 、mysql8 edition 、Dell G3 The computer .
“mysql.sock” yes mysql Socket file for .
stay UNIX Local connection under system MySQL May adopt UNIX Domain socket mode , This requires a socket file
The socket file can be defined by parameters socket control , You can use the following command to view the location of the file :
show variables like 'socket'\G;

mysql.sock yes mysql The host and client of are in the same host Last time , Use unix domain socket As the carrier of communication protocol , It is better than tcp fast .
MySQL There are two main ways to connect :
(1)TCP/IP
(2)socket
The most common one is TCP Connect :
[[email protected] data]# mysql -h 192.168.103.67 -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 14Server version: 8.0.15 MySQL Community Server - GPLCopyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>
Another way is this unix socket The connection of . Compare with... In speed tcp It's faster , But only for mysql With the application PC On , Rely on local .sock file . If it's not on the same station PC On , There's no way to connect .
Yes mysql.sock Come on , Its function is to program with MySQL Server On the same machine , Available when a local connection is initiated .
For example, you don't need to define a connection host The specific IP have to , As long as it is empty or empty localhost Can .
In this case , Even if you change MySQLl The outside of the port It's also possible to connect normally .
Because you are my.ini Medium or my.cnf After changing the port in ,mysql.sock Every time MySQL Server Start the generated . It has been changed according to you my.cnf Restart after mysql It was regenerated once , The information has changed .
So for external connections , Must be changed port To connect .
Linux Lower installation MySQL When connecting, you often reply that you can't find mysql.sock file , The solution is simple :
If it is a new installation MySQL, Prompt file not found , Just search , Specify the correct location .
If mysql.sock If the document is deleted by mistake , You need to restart MySQL service , If the restart is successful, it will be in datadir Generate... Under directory mysql.sock Then you can specify .
If not, choose to use TCP Just connect the way you connect , Actually windows It also supports pipeline connection mode .
Thank you for reading , That's all “mysql.sock What is the concept of ” Content. , After learning this article , I'm sure you're right mysql.sock I have a deeper understanding of what is the concept of , The specific use needs to be verified by practice . This is billion speed cloud , Xiaobian will push you articles with more relevant knowledge points , Welcome to your attention !
边栏推荐
- 适合中小企业的项目管理系统有哪些?
- 微信小程序开发储备知识
- Summary of problems during xampp Apache installation
- 0基础自学STM32(野火)——使用寄存器点亮LED——GPIO功能框图讲解
- PancakeSwap技术:夹子机器人系统开发原理
- Use SSH to pull codes
- Naacl 2022 | distillation of machinetranslation SOTA model
- Solid state storage manufacturer Yilian joins dragon dragon community to build a new open source ecosystem
- 0 basic self-study STM32 (wildfire) -- use register to light LED -- Explanation of GPIO function block diagram
- 【Oracle】基础知识面试题
猜你喜欢

Subgraphs in slam
Help MySQL data analysis with databend

PCB frame drawing - ad19

SLAM中的子图
![[R language data science]: Text Mining (taking Trump's tweet data as an example)](/img/4f/09b9885915bee50fb40976a5002730.png)
[R language data science]: Text Mining (taking Trump's tweet data as an example)

In depth analysis of Monai (I) data and transforms

mysql如何查询表的字符集编码

Function calculation asynchronous task capability introduction - task trigger de duplication

微信小程序开发储备知识

NAACL 2022 | 机器翻译SOTA模型的蒸馏
随机推荐
535. TinyURL 的加密与解密 / 剑指 Offer II 103. 最少的硬币数目
Open source warehouse contribution - submit pr
Browser large screen capture
0 basic self-study STM32 (wildfire) -- use register to light LED -- Explanation of GPIO function block diagram
C comparison of the performance of dapper efcore sqlsugar FreeSQL hisql sqlserver, an ORM framework at home and abroad
PancakeSwap技术:夹子机器人系统开发原理
有遇到用flink-cdc采集MySQL-RDS的时候,datetime类型的字段,采集过来后和源表
Issue 42: is it necessary for MySQL to have multiple column partitions
Leetcode daily question - 535 Encryption and decryption of tinyurl
使用 SSH 方式拉取代码
The fixed assets management system enables enterprises to dynamically master assets
Summary of problems during xampp Apache installation
在供应链场景应用中,供应链管理系统扮演什么角色?
Gradle download slow or unable to download
R语言使用自定义函数编写深度学习线性激活函数、并可视化线性激活函数
R语言ggplot2可视化:使用patchwork包(直接使用加号+)将一个ggplot2可视化结果和一个plot函数可视化结果横向组合起来形成最终结果图
0基础自学STM32(野火)——寄存器点亮LED
2022 software evaluator examination outline
卷妹带你学jdbc—2天冲刺Day1
R语言使用MASS包的glm.nb函数建立负二项广义线性模型(negative binomial)、summary函数获取负二项广义线性模型模型汇总统计信息