当前位置:网站首页>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 !
边栏推荐
猜你喜欢

微信小程序开发储备知识

Word2vec vector model of Wiki Chinese corpus based on deep learning

如何创建虚拟形象

ICML 2022 | 基于解耦梯度优化的可迁移模仿学习方法

Function calculation asynchronous task capability introduction - task trigger de duplication

mysql在linux中2003错误如何解决

PCB板框的绘制——AD19

在线文本数字识别列表求和工具

High landing pressure of "authorization and consent"? Privacy computing provides a possible compliance "technical solution"
![[the sixth operation of modern signal processing]](/img/49/7844a00077e56fd4d73e3ba515f8a6.png)
[the sixth operation of modern signal processing]
随机推荐
The dplyr package filter function of R language filters the data in dataframe data through combinatorial logic (and logic). The content of one field is equal to one of the specified vectors, and the v
Kubernetes部署Dashboard(WEB UI管理界面)
Word2vec vector model of Wiki Chinese corpus based on deep learning
Browser large screen capture
Collaborative development of epidemic home outsourcing project 𞓜 community essay solicitation
Redis 原理 - Sorted Set (ZSet)
从居家办公中感悟适配器模式 | 社区征文
Mysql高可用集群–MHA
深圳内推 | 深圳计算科学研究院招聘机器学习助理工程师(校招)
关于Go中两个模块互相调用的场景解决方案
Understanding adapter mode from home office | community essay solicitation
R语言ggplot2可视化:使用patchwork包(直接使用加号+)将一个ggplot2可视化结果和一个plot函数可视化结果横向组合起来形成最终结果图
【现代信号处理第六次作业】
mysql数据库扫盲,你真的知道什么是数据库嘛
线段树、树状数组模板(复制粘贴确实好用)
Gradle download slow or unable to download
Online text digit recognition list summation tool
Bags of Binary Words for Fast Place Recognition in Image Sequenc
KUKA机器人外部轴配置你一定要知道的那些知识
Bags of Binary Words for Fast Place Recognition in Image Sequenc