微信微网站建设平台/代运营是什么意思
文章目录
- 【MySQL】如何使用Named Pipe协议(Windows)连接MySQL数据库
- 连接MySQL的协议
- 使用Named Pipe协议(Windows)连接MySQL
- 步骤1:确认MySQL服务器已启用Named Pipe连接
- 启动Named Pipe连接方法
- 步骤2:客户端使用Named Pipe连接MySQL服务器。
- 例1:客户端使用Named Pipe连接MySQL服务器
- 例2:客户端指定Socket使用Named Pipe连接MySQL服务器
- 常见错误
- 小结
MySQL入门02:关于MySQL连接的ABC
【MySQL】如何使用Named Pipe协议(Windows)连接MySQL数据库
【MySQL】如何使用Shared-memory协议(Windows)连接MySQL数据库
【MySQL】如何使用Unix Sockets 协议连接MySQL数据库
【MySQL】如何使用Named Pipe协议(Windows)连接MySQL数据库
连接MySQL的协议
在MySQL中可以通过指定 --protocol参数,选择连接MySQL的协议。
连接协议(Connection Protocals):
--protocol={TCP|SOCKET|PIPE|MEMORY}TCP/IP (ALL) -Transmission Control Protocal/Internet Protocal-Connection:local & remote-Supports Clasic & X protocol
Socket file (Unix including Linux/Mac) -Connection:local -Supports Clasic & X protocol
Named Pipe (Win) -Connection:local -Supports Clasic
Shared Memory (Win) -Connection:local -Supports Clasic
参考:
https://dev.mysql.com/doc/refman/8.0/en/connection-options.html#option_general_protocol
>4.2.3 Command Options for Connecting to the Server
使用Named Pipe协议(Windows)连接MySQL
在Windows环境中,和Unix Sockets连接MySQL相似,可以用Named Pipe协议连接MySQL。
下面介绍如何使用Named Pipe连接MySQL的步骤。
步骤1:确认MySQL服务器已启用Named Pipe连接
查看是否启用Named Pipe连接。
mysql> SHOW GLOBAL VARIABLES LIKE 'named_pipe';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| named_pipe | OFF |
+---------------+-------+
1 row in set, 1 warning (0.04 sec)mysql>
如果值是ON,则表示启用;OFF表示禁用状态。
启动Named Pipe连接方法
- 打开配置文件my.ini,将enable-named-pipe变量和socket变量前的注释去掉并保存。
例:
# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
enable-named-pipe
# shared-memory# shared-memory-base-name=MYSQL# The Pipe the MySQL Server will use.
socket=MYSQL
※ my.ini文件的位置可以通过【mysql --help】命令中的Default options内容查看。
例:
Default options are read from the following files in the given order:
C:\windows\my.ini C:\windows\my.cnf C:\my.ini C:\my.cnf E:\Soft\MySQL8.0\my.ini E:\Soft\MySQL8.0\my.cnf```
- 重新启动MySQL服务器。
net stop <MySQL服务名>
net start <MySQL服务名>
例:
C:\Users\Administrator>net stop mysql80
MySQL80 服务正在停止.
MySQL80 服务已成功停止。C:\Users\Administrator>net start mysql80
MySQL80 服务正在启动 ..
MySQL80 服务已经启动成功。
3.查看Named Pipe连接启用状态。
C:\Users\Administrator>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.28 MySQL Community Server - GPLCopyright (c) 2000, 2022, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> SHOW GLOBAL VARIABLES LIKE 'named_pipe';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| named_pipe | ON |
+---------------+-------+
1 row in set, 1 warning (0.01 sec)mysql> SHOW VARIABLES LIKE 'socket';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| socket | MYSQL |
+---------------+-------+
1 row in set, 1 warning (0.01 sec)mysql> exit
Bye
步骤2:客户端使用Named Pipe连接MySQL服务器。
例1:客户端使用Named Pipe连接MySQL服务器
通过指定–protocol=pipe,客户端可以使用Named Pipe连接MySQL服务器。
C:\Users\Administrator>mysql --protocol=pipe -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.28 MySQL Community Server - GPLCopyright (c) 2000, 2022, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> \s
--------------
mysql Ver 8.0.28 for Win64 on x86_64 (MySQL Community Server - GPL)Connection id: 10
Current database:
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 8.0.28 MySQL Community Server - GPL
Protocol version: 10
Connection: Named pipe: MySQL
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: gbk
Conn. characterset: gbk
UNIX socket: MySQL
Binary data as: Hexadecimal
Uptime: 7 min 22 secThreads: 2 Questions: 16 Slow queries: 0 Opens: 137 Flush tables: 3 Open tables: 56 Queries per second avg: 0.036
--------------mysql>
不指定Socket的时候,会使用默认的Named pipe: MySQL。
例2:客户端指定Socket使用Named Pipe连接MySQL服务器
C:\Users\Administrator>mysql --protocol=pipe -u root -p --socket=MYSQL
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.28 MySQL Community Server - GPLCopyright (c) 2000, 2022, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> \s
--------------
mysql Ver 8.0.28 for Win64 on x86_64 (MySQL Community Server - GPL)Connection id: 11
Current database:
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 8.0.28 MySQL Community Server - GPL
Protocol version: 10
Connection: Named pipe: MYSQL
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: gbk
Conn. characterset: gbk
UNIX socket: MYSQL
Binary data as: Hexadecimal
Uptime: 13 min 4 secThreads: 2 Questions: 25 Slow queries: 0 Opens: 138 Flush tables: 3 Open tables: 57 Queries per second avg: 0.031
--------------mysql> exit
Bye
常见错误
当服务器Named Pipe连接未启用的时候,使用Named Pipe连接会报如下的错误:
C:\Users\Administrator>mysql --protocol=pipe -u root -prootroot
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2017 (HY000): Can't open named pipe to host: . pipe: MySQL (2)
可参考如上的方法在服务器端进行相应的配置。
小结
本文介绍了在Windows环境中,如何使用Named Pipe协议连接MySQL数据库的方法。
相关文章:

【MySQL】如何使用Named Pipe协议(Windows)连接MySQL数据库
文章目录 【MySQL】如何使用Named Pipe协议(Windows)连接MySQL数据库连接MySQL的协议使用Named Pipe协议(Windows)连接MySQL步骤1:确认MySQL服务器已启用Named Pipe连接启动Named Pipe连接方法 步骤2:客户端使用Named Pipe连接MySQL服务器。例1ÿ…...

【c++】c++的一些技术操作
pthread_create 的第三个参数,为函数指针,指向处理线程函数的地址。该函数,要求为静态函数。如果处理线程函数为类成员函数时,需要将其设置为静态成员函数。C静态成员函数访问非静态成员 https://blog.csdn.net/yueguangmuyu/arti…...

JS中对象数组深拷贝方法
structuredClone() JavaScript 中提供了一个原生 API 来执行对象的深拷贝:structuredClone。它可以通过结构化克隆算法创建一个给定值的深拷贝,并且还可以传输原始值的可转移对象。 当对象中存在循环引用时,仍然可以通过 structuredClone()…...

2022数学建模国赛C题官网展示论文C155论文复现
2022数学建模国赛C题C155论文复现 1.内容比对2.第一问第二小问复现代码2.1 页表合并2.2 数据的正态性检验2.2.1数据的正态性检验效果图 2.3不满足正态性,进行中心化对数比变换2.3.1 核心步骤-inf用0值替换2.3.2中心化对数比变换效果图 2.4描述性统计2.5 箱线图绘制 …...

阿里云 K8s PVC 绑定 StorageClass 申领 PV 失败
错误场景: 因为阿里云没有默认的 StorageClass 我也懒得更新,所以就创建了一个类型是云盘的 StorageClass。 但是在创建 PVC 之后发现一直是 Pending 状态就查询了一下日志,然后看到很多下面这种错误 liuduiMacBookM1Pro ~ % kubectl describe pvc graf…...

php数组
php数组是什么? 可以使用单个变量名存储多个不同类型的数据的特殊变量,这就是php数组。 php数组就是一个特殊的变量,它允许存储多个任意类型的数据。 创建数组 php数组有两种类型,分为索引数组和关联数组。 创建数组的方法有三种…...

构造不包含字母和数字的webshell
构造不包含字母和数字的webshell <?php echo "A"^""; ?> 输出的结果是字符"!“。之所以会得到这样的结果,是因为代码中对字符"A"和字符”"进行了异或操作。在PHP中,两个变量进行异或时,…...

中国大学生服务外包创新创业大赛丨借 AI 之力,助“记账”难题
一、中国大学生服务外包创新创业大赛 赛事介绍 中国大学生服务外包创新创业大赛,是响应国家关于鼓励服务外包产业发展、加强服务外包人才培养的相关战略举措与号召,举办的每年一届的全国性竞赛。 大赛均由中华人民共和国教育部、中华人民共和国商务部…...

MacOS 安装Redis并设置密码
在开发过程中,需要本地进行安装Redis进行测试,记录了下MacOS环境下安装Redis,以及设置密码。 Brew 安装 $ brew install redis启动服务 # 启动服务 brew services start redis # 关闭服务 brew services stop redis # 重启服务 brew servic…...

函数的参数作为引用
文章目录 1. num,list ,tuple2. list 作为默认值导致共享同一列表3. 防御可变参数4. 结论 1. num,list ,tuple 结论:num ,tuple 作为参数,自身不会因为函数的原因而改变,list 为可变量,会因为函数变而变。 测试 def f(a, b):a …...

【文化课学习笔记】【化学】非金属及其化合物
【化学】必修一:非金属及其化合物 硅及其化合物 硅单质 物理性质 单晶硅的结构与金刚石类似,为正四面体的立体网状结构。晶体中每个硅原子与其他四个硅原子相连接。\(1\mathrm{mol}\) 硅单质还有 \(\mathrm{2N_A}\) 个 \(\mathrm{Si-Si}\) 键;…...

Unity进阶–通过PhotonServer实现联网登录注册功能(客户端)–PhotonServer(三)
文章目录 Unity进阶–通过PhotonServer实现联网登录注册功能(客户端)–PhotonServer(三)前情提要客户端部分 Unity进阶–通过PhotonServer实现联网登录注册功能(客户端)–PhotonServer(三) 前情提要 单例泛型类 using System.Collections; using System.Collections.Generic; …...

步步向前,曙光已现:百度的大模型之路
大模型,是今年全球科技界最火热,最耀眼的关键词。在几个月的狂飙突进中,全球主要科技公司纷纷加入了大模型领域。中国AI产业更是开启了被戏称为“百模大战”的盛况。 但喧嚣与热闹之后,新的问题也随之而来:大模型的力量…...

常见的 Python 错误及其解决方案
此文整理了一些常见的 Python 错误及其解决方案。 1、SyntaxError: invalid syntax 说明:无效的语法是最常见的错误之一,通常是由于编写代码时违反了 Python 的语法规则。可能的原因: 忘记在 if、while、for 等语句后写冒号,或者…...

文章评论以及回复评论邮件通知(Go 搭建 qiucode.cn 之八)
要说到评论。无疑是博客应用的灵魂所在了,它也正是站长与博友、博友与博友之间互相交流的桥梁,倘若少了它,博客应用将变得暗淡无关,索然无味,恍如一具躺在床榻上的植物人,终究是无法与周边人言语的。 也正是有了评论,站长在该博客应用所发表的博文,博友才得以通过评论,…...

java面试基础 -- ArrayList 和 LinkedList有什么区别, ArrayList和Vector呢?
目录 基本介绍 有什么不同?? ArrayList的扩容机制 ArrayLIst的基本使用 ArrayList和Vector 基本介绍 还记得我们的java集合框架吗, 我们来复习一下, 如图: 可以看出来 ArrayList和LinkedList 都是具体类, 他们都是接口List的实现类. 但是他们底层的逻辑是不同的, 相信…...

matlab 点云最小二乘拟合空间直线(方法一)
目录 一、算法原理1、空间直线2、最小二乘法拟合二、代码实现三、结果展示四、可视化参考本文由CSDN点云侠原创,原文链接。如果你不是在点云侠的博客中看到该文章,那么此处便是不要脸的爬虫。 一、算法原理 1、空间直线 x...

详解junit
目录 1.概述 2.断言 3.常用注解 3.1.Test 3.2.Before 3.3.After 3.4.BeforeClass 3.5.AfterClass 4.异常测试 5.超时测试 6.参数化测试 1.概述 什么是单元测试: 单元测试,是针对最小的功能单元编写测试代码,在JAVA中最小的功能单…...

Nginx的安装及负载均衡搭建
一.Nginx的安装 1)准备安装环境 yum install -y make gcc gcc-c pcre-devel pcre zlib zlib-devel openssl openssl-develPERE PCRE(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正则表达式库。 nginx的http模块使用pcre来解…...

JVM学习笔记(一)
1. JVM快速入门 从面试开始: 请谈谈你对JVM 的理解?java8 的虚拟机有什么更新? 什么是OOM ?什么是StackOverflowError?有哪些方法分析? JVM 的常用参数调优你知道哪些? 内存快照抓取和MAT分…...

fastjson 序列化问题:Comparison method violates its general contract
fastjson 序列化问题:Comparison method violates its general contract 问题重现 今天在测试接口的时候,调用了Mybatis Plus 分页查询的接口,然后将查询的结果转换成 Json字符串的形式,结果报了这个错误: java.lang.…...

Angular安全专辑之二——‘unsafe-eval’不是以下内容安全策略中允许的脚本源
一:错误出现 这个错误的意思是,拒绝将字符串评估为 JavaScript,因为‘unsafe-eval’不是以下内容安全策略中允许的脚本源。 二:错误场景 testEval() {const data eval("var sum2 new Function(a, b, return a b); sum2(em…...

十一、Linux用户及用户组的权限信息如何查看?如何修改?什么是权限的数字序号?
目录: 1、认知权限信息 2、rwx? (1)总括: (2)r权限: (3)w权限: (4)x权限: 3、修改权限 (1&a…...

ahooks.js:一款强大的React Hooks库及其API使用教程(二)
一、ahooks.js简介二、ahooks.js安装三、继续ahooks.js API的介绍与使用教程21. useLocalStorageState22. useSessionStorageState23. useClickAway24. usePersistFn25. useCreation26. useFullscreen27. useInViewport28. useInfiniteScroll29. usePagination30. useDynamicLi…...

ARM 配置晶振频率
文章目录 前言串口乱码问题定位内核修改晶振频率uboot 修改晶振频率番外篇 前言 上篇文章《ARM DIY 硬件调试》介绍了 DIY ARM 板的基础硬件焊接,包括电源、SOC、SD 卡座等,板子已经可以跑起来了。 但是发现串口乱码,今天就来解决串口乱码问…...

最强自动化测试框架Playwright(37)-网络
介绍 Playwright 提供 API 来监控和修改浏览器网络流量,包括 HTTP 和 HTTPS。页面执行的任何请求,包括 XHR 和获取请求,都可以被跟踪、修改和处理。 模拟接口 查看我们的 API 模拟指南,了解有关如何 模拟 API 请求,…...

Ant Design Pro 前端脚手架 配置混合导航
Ant Design Pro脚手架 点击查看阅读 混合导航: 顶部导航和侧边栏导航实现联动效果,点击不同的顶部导航按钮会显示对应的子菜单项。 实现点: 1. 路由的配置 菜单展示 我们可以在 route 中进行 menu 相关配置,来决定当前路由是否…...

tcl学习之路(五)(Vivado时序约束)
1.主时钟约束 主时钟通常是FPGA器件外部的板机时钟或FPGA的高速收发器输出数据的同步恢复时钟信号等。下面这句语法大家一定不会陌生。该语句用于对主时钟的名称、周期、占空比以及对应物理引脚进行约束。 create_clock -name <clock_name> -periood <period> -wa…...

Hlang-中英双语言编程语言使用手册
文章目录 介绍Hlang基本使用下载配置环境变量特性中文关键字支持中文符号混合编程中文错误提示终端多行输入基本数据类型整数浮点数列表字符串基本操作变量定义逻辑判断基本运算条件判断循环函数介绍 Hlang是一款基于Python编写的支持中英文混合编程的动态语言。其简单易上手,…...

centos 7 安装docker
系统配置: CentOS关闭selinux sed -i s/SELINUXenforcing/SELINUXdisabled/g /etc/selinux/config关闭防火墙(可选)或者放行相应端口 systemctl stop firewalld.service && systemctl disable firewalld.service配置内核IP 转发 net.ipv4.ip_forward1 dock…...