赞
踩
连接层为每个连接维护一个线程。该线程处理查询执行。 在连接可以开始发送 SQL 查询之前,连接由验证用户名、密码和客户端主机。 连接层通过多种连接协议接受来自应用程序的连接:
如下图所示:
修改my.cnf
admin_address='localhost'
修改前后对比:
[root@hadoop1 ~]# mysql -e "show variables like 'admin%'"; +------------------------+-----------------+ | Variable_name | Value | +------------------------+-----------------+ | admin_address | | | admin_port | 33062 | | admin_ssl_ca | | | admin_ssl_capath | | | admin_ssl_cert | | | admin_ssl_cipher | | | admin_ssl_crl | | | admin_ssl_crlpath | | | admin_ssl_key | | | admin_tls_ciphersuites | | | admin_tls_version | TLSv1.2,TLSv1.3 | +------------------------+-----------------+ [root@hadoop1 ~]# systemctl restart mysqld.service [root@hadoop1 ~]# mysql -e "show variables like 'admin%'"; +------------------------+-----------------+ | Variable_name | Value | +------------------------+-----------------+ | admin_address | localhost | | admin_port | 33062 | | admin_ssl_ca | | | admin_ssl_capath | | | admin_ssl_cert | | | admin_ssl_cipher | | | admin_ssl_crl | | | admin_ssl_crlpath | | | admin_ssl_key | | | admin_tls_ciphersuites | | | admin_tls_version | TLSv1.2,TLSv1.3 | +------------------------+-----------------+ [root@hadoop1 ~]#
成功登录:
[root@hadoop1 ~]# mysql -P 33062
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 8.0.28 MySQL Community Server - GPL
Copyright (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>
网络监听情况:
[root@hadoop1 ~]# netstat -anltp | grep 33062
tcp 0 0 127.0.0.1:33062 0.0.0.0:* LISTEN 1104641/mysqld
[root@hadoop1 ~]#
设置最大连接数方便测试:
mysql> set global max_connections = 1;
Query OK, 0 rows affected (0.00 sec)
重新连接:
[root@hadoop1 ~]# mysql ERROR 1040 (HY000): Too many connections [root@hadoop1 ~]# mysql -P 33062 --protocol tcp Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 21 Server version: 8.0.28 MySQL Community Server - GPL Copyright (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>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。