当前位置: 首页 > news >正文

张掖北京网站建设韩国购物网站模板

张掖北京网站建设,韩国购物网站模板,大连模板网站制作电话,百度seo有用吗文章目录 【MySQL】如何使用Unix Sockets 协议连接MySQL数据库连接MySQL的协议使用Unix Sockets 连接MySQL步骤1#xff1a;确认MySQL服务器已启用Unix Sockets支持步骤2 #xff1a;客户端使用Unix Sockets连接MySQL服务器。例1#xff1a;指定socket路径连接列2#xff1… 文章目录 【MySQL】如何使用Unix Sockets 协议连接MySQL数据库连接MySQL的协议使用Unix Sockets 连接MySQL步骤1确认MySQL服务器已启用Unix Sockets支持步骤2 客户端使用Unix Sockets连接MySQL服务器。例1指定socket路径连接列2 不指定socket路径 Linux环境下hostname为localhost时候默认是socket连接例3指定TCP/IP 连接MySQL 小结 MySQL入门02关于MySQL连接的ABC 【MySQL】如何使用Named Pipe协议(Windows)连接MySQL数据库 【MySQL】如何使用Shared-memory协议(Windows)连接MySQL数据库 【MySQL】如何使用Unix Sockets 协议连接MySQL数据库 【免责声明】文章仅供学习交流观点代表个人与任何公司无关。 编辑|SQL和数据库技术(ID:SQLplusDB) 【MySQL】如何使用Unix Sockets 协议连接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 使用Unix Sockets 连接MySQL 使用Unix Sockets连接MySQL避免了网络通信的开销和潜在的安全风险因此可以提高性能和安全性。 下面介绍如何使用Unix Sockets连接MySQL的步骤。 步骤1确认MySQL服务器已启用Unix Sockets支持 可以通过检查MySQL配置文件中的socket选项来确认MySQL服务器已启用Unix Sockets支持。 默认情况下socket选项设置为/var/run/mysqld/mysqld.sock。 例 ubuntumysql-vm:~$ mysql -u root -p -h 127.0.0.1 -e select socket Enter password: ----------------------------- | socket | ----------------------------- | /var/run/mysqld/mysqld.sock | -----------------------------或者 mysql show variables like socket; -------------------------------------------- | Variable_name | Value | -------------------------------------------- | socket | /var/run/mysqld/mysqld.sock | -------------------------------------------- 1 row in set (0.00 sec)mysql或者 查看MySQL配置文件的socket 设置。 sudo more /etc/mysql/mysql.conf.d/mysql.cnf sudo more /etc/mysql/mysql.conf.d/mysqld.cnf[mysqld] # # * Basic Settings # user mysql # pid-file /var/run/mysqld/mysqld.pid # socket /var/run/mysqld/mysqld.sock # port 3306 # datadir /var/lib/mysql步骤2 客户端使用Unix Sockets连接MySQL服务器。 大多数MySQL客户端都支持Unix Sockets但是需要使用正确的选项来指定路径。 例如使用mysql客户端时可以使用–socket选项来指定Unix Sockets路径。 mysql --socket/var/run/mysqld/mysqld.sock -u username -p其中–socket选项指定Unix Sockets路径-u选项指定用户名-p选项提示输入密码。 例1指定socket路径连接 ubuntumysql-vm:/etc/mysql/mysql.conf.d$ mysql --socket/var/run/mysqld/mysqld.sock -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 24 Server version: 8.0.33-0ubuntu0.22.04.2 (Ubuntu)Copyright (c) 2000, 2023, 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.33-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu))Connection id: 24 Current database: Current user: rootlocalhost SSL: Not in use Current pager: stdout Using outfile: Using delimiter: ; Server version: 8.0.33-0ubuntu0.22.04.2 (Ubuntu) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4 UNIX socket: /var/run/mysqld/mysqld.sock Binary data as: Hexadecimal Uptime: 2 hours 13 min 49 secThreads: 2 Questions: 54 Slow queries: 0 Opens: 158 Flush tables: 3 Open tables: 77 Queries per second avg: 0.006 --------------mysql列2 不指定socket路径 Linux环境下hostname为localhost时候默认是socket连接 在Linux环境下hostname为localhost时候默认是socket连接 ubuntumysql-vm:/etc/mysql/mysql.conf.d$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 25 Server version: 8.0.33-0ubuntu0.22.04.2 (Ubuntu)Copyright (c) 2000, 2023, 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.33-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu))Connection id: 25 Current database: Current user: rootlocalhost SSL: Not in use Current pager: stdout Using outfile: Using delimiter: ; Server version: 8.0.33-0ubuntu0.22.04.2 (Ubuntu) Protocol version: 10 Connection: Localhost via UNIX socket Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4 UNIX socket: /var/run/mysqld/mysqld.sock Binary data as: Hexadecimal Uptime: 2 hours 16 min 42 secThreads: 2 Questions: 59 Slow queries: 0 Opens: 158 Flush tables: 3 Open tables: 77 Queries per second avg: 0.007 --------------mysql例3指定TCP/IP 连接MySQL ubuntumysql-vm:/etc/mysql/mysql.conf.d$ mysql -u root -p --protocolTCP Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 26 Server version: 8.0.33-0ubuntu0.22.04.2 (Ubuntu)Copyright (c) 2000, 2023, 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.33-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu))Connection id: 26 Current database: Current user: rootlocalhost SSL: Cipher in use is TLS_AES_256_GCM_SHA384 Current pager: stdout Using outfile: Using delimiter: ; Server version: 8.0.33-0ubuntu0.22.04.2 (Ubuntu) Protocol version: 10 Connection: localhost via TCP/IP Server characterset: utf8mb4 Db characterset: utf8mb4 Client characterset: utf8mb4 Conn. characterset: utf8mb4 TCP port: 3306 Binary data as: Hexadecimal Uptime: 2 hours 17 min 45 secThreads: 2 Questions: 64 Slow queries: 0 Opens: 158 Flush tables: 3 Open tables: 77 Queries per second avg: 0.007 --------------mysql连接成功进入MySQL客户端提示符后就可以使用标准的MySQL命令来执行查询和操作。 ※注意 使用Unix Sockets连接MySQL需要在同一台机器上运行MySQL服务器和客户端Sockets仅支持本地连接。 如果需要在不同的机器上连接MySQL服务器则需要使用TCP/IP连接TCP/IP支持本地或远程连接。 小结 本文介绍了如何使用Unix Sockets连接MySQL数据库的方法。
http://www.zqtcl.cn/news/20664/

相关文章:

  • 杭州行业网站建设权重较高网站
  • 在dw里如何做网站线上推广平台报价
  • 泗县网站建设企业网站多大空间够用
  • html5商业网站开发北大青鸟seo外贸 网站公司推荐
  • 郑州seo网站排名优化公司淘宝关键词推广
  • 做矿产公司的网站wordpress在哪里打开
  • 源码网站建设wordpress婚纱主题
  • html在线记账网站模板wordpress文章倒计时
  • 哪里有网站推广优化百度推广免费
  • 温州企业网站设计做网站工作职责
  • 网站有图片的验证码是怎么做的怎么用文件做网站
  • 网站推广软件下载网站怎么做qq登录
  • 淘宝网站优化实例江门骏科网站建设
  • 深圳网站建设服务哪家便宜设计制作实践活动有哪些
  • 住房及城乡建设部网站wordpress主机推荐
  • 牛商网网站做seo好么软件开发的自学教程
  • 安全联盟这种网站建设开发公司成本部职责岗位职责和流程
  • 福田网站开发仪陇建设局网站
  • 网站后台管理默认密码企业为什么建设网站
  • 企业门户网站建设机构wordpress怎么上传图片
  • 网站改版怎样做301天眼查官网登录入口
  • 国外做名片的网站网站项目整体思路
  • 建设网站后如何上线上海今天新闻综合频道
  • 网络设计网站技术支持凯里网站建设
  • wordpress与广告有关的主题广州优化网站排名
  • 网页配色的技巧是什么无锡网站广优化公司
  • 沈阳网站关键词优化公司搜狗搜索引擎优化
  • 织梦网站被做跳转怎么下载网页视频到本地
  • 苏州自学网站建设平台商标免费查询入口
  • 网站后台管理系统 源码如何给自己公司做一个网站