当前位置:网站首页>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 !
边栏推荐
- LSB hidden items of stream carrier based on assembly implementation
- PancakeSwap技术:夹子机器人系统开发原理
- What are the advantages of SaaS services
- What are the project management systems suitable for small and medium-sized enterprises?
- 使用 SSH 方式拉取代码
- 2020版KALI安装教程
- 力扣今日题-535. TinyURL 的加密与解密
- R语言dplyr包filter函数通过组合逻辑(与逻辑)过滤dataframe数据中的数据、其中一个字段的内容等于指定向量中的其中一个,并且另外一个字段值大于某一阈值
- SpingMVC请求和响应
- 自定义HandlerInterceptor拦截器实现用户鉴权
猜你喜欢
随机推荐
从Mpx资源构建优化看splitChunks代码分割
An error is reported in the Flink SQL rownumber. Who has met him? How to solve it?
基于汇编实现的流载体的LSB隐藏项目
mysql数据库扫盲,你真的知道什么是数据库嘛
InheritableThreadLocal 在线程池中进行父子线程间消息传递出现消息丢失的解析
LeetCode 每日一题——535. TinyURL 的加密与解密
Issue 42: is it necessary for MySQL to have multiple column partitions
Error:Connection refused: connect
sequential detector
Browser large screen capture
Gradle download slow or unable to download
About Kali using xshell connection
MySQL触发器如何创建与删除
Shenzhen internal promotion | Shenzhen Institute of computing science recruits assistant machine learning Engineer (school recruitment)
正则表达式
535. TinyURL 的加密与解密 / 剑指 Offer II 103. 最少的硬币数目
R语言ggplot2可视化:使用patchwork包(直接使用加号+)将一个ggplot2可视化结果和一个plot函数可视化结果横向组合起来形成最终结果图
关于KALI使用xshell连接
First batch! Tencent cloud's ability to pass the solution of the government affairs collaboration platform of the China Academy of ICT
2022年软件评测师考试大纲