当前位置:网站首页>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 !
边栏推荐
- R语言使用自定义函数编写深度学习线性激活函数、并可视化线性激活函数
- 在供应链场景应用中,供应链管理系统扮演什么角色?
- 从居家办公中感悟适配器模式 | 社区征文
- Redis布隆过滤器和布谷鸟过滤器
- mysql游标的作用是什么
- c# 国内外ORM 框架 dapper efcore sqlsugar freesql hisql sqlserver数据常规插入测试性能对比
- Bags of Binary Words for Fast Place Recognition in Image Sequenc
- R语言使用epiDisplay包的kap函数(kap.2.raters函数)计算Kappa统计量的值(总一致性、期望一致性)、对两个评分对象的结果进行一致性分析、评分的类别为多个类别
- R语言ggplot2可视化:使用patchwork包(直接使用加号+)将两个ggplot2可视化结果横向组合、接着再和第三个图像横向组合起来(三幅图各占比例为50%、25%、25%)
- @Difference between component and @configuration
猜你喜欢

NAACL 2022 | 机器翻译SOTA模型的蒸馏

mysql在linux中2003错误如何解决

windows平台下的mysql启动等基本操作

【R语言数据科学】:文本挖掘(以特朗普推文数据为例)

自动收售报机

“授权同意”落地压力大?隐私计算提供一种可能的合规“技术解”

mysql查询视图命令是哪个

0 basic self-study STM32 (wildfire) -- use register to light LED -- Explanation of GPIO function block diagram

@Component与@Configuration区别

基于汇编实现的流载体的LSB隐藏项目
随机推荐
PancakeSwap技术:夹子机器人系统开发原理
What are the advantages of SaaS services
如何创建虚拟形象
Mysql高可用集群–MHA
c# 国内外ORM 框架 dapper efcore sqlsugar freesql hisql sqlserver数据常规插入测试性能对比
自动收售报机
About harbor private warehouse forgetting the login password
在供应链场景应用中,供应链管理系统扮演什么角色?
LSB hidden items of stream carrier based on assembly implementation
0基础自学STM32(野火)——使用寄存器点亮LED——GPIO功能框图讲解
腾讯云发布自动化交付和运维产品Orbit,推动企业应用全面云原生化
深圳内推 | 深圳计算科学研究院招聘机器学习助理工程师(校招)
L'intercepteur handlerinterceptor personnalisé permet l'authentification de l'utilisateur
Use SSH to pull codes
mysql在linux中2003错误如何解决
ICML 2022 | 基于解耦梯度优化的可迁移模仿学习方法
基于汇编实现的流载体的LSB隐藏项目
C comparison of the performance of dapper efcore sqlsugar FreeSQL hisql sqlserver, an ORM framework at home and abroad
卷妹带你学jdbc—2天冲刺Day1
【现代信号处理第六次作业】