message from server: "Host 'DESKTOP-U79FCE6' is not allowed to connect to this MySQL server"

连完公司的数据库,想偷懒直接改成自己本机网关后的一位,

报这个错误是因为我连接数据库用的是自己本机的ip 192.168.xx.xx,

打开mysql控制台发现 没有这个用户

所以改成 127.0.0.1 或者localhost就好了

我把日志级别改成了debug,首先权限,命令都是无问题,权限给的最高,命令我手动ssh登录控制台都可正常显示,也会报错,但是这个程序命令执行在交换机后台日志看只正确了执行quit这条命令,其余都未执行,程序日志如下:2025-07-15 14:21:27,593 - DEBUG - read_channel: 2025-07-15 14:21:29,594 - DEBUG - read_channel: 2025-07-15 14:21:29,594 - DEBUG - write_channel: b&#39;quit\n&#39; 2025-07-15 14:21:29,594 - DEBUG - EOF in transport thread 2025-07-15 14:21:29,595 - INFO - 172.17.201.28 是已知汇聚交换机,作为最终设备 2025-07-15 14:21:29,608 - DEBUG - starting thread (client mode): 0x7a64f2f0 2025-07-15 14:21:29,608 - DEBUG - Local version/idstring: SSH-2.0-paramiko_3.5.1 2025-07-15 14:21:29,609 - DEBUG - Remote version/idstring: SSH-1.99-Comware-5.20 2025-07-15 14:21:29,609 - INFO - Connected (version 1.99, client Comware-5.20) 2025-07-15 14:21:29,631 - DEBUG - === Key exchange possibilities === 2025-07-15 14:21:29,631 - DEBUG - kex algos: diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1, diffie-hellman-group1-sha1 2025-07-15 14:21:29,631 - DEBUG - server key: ssh-rsa 2025-07-15 14:21:29,631 - DEBUG - client encrypt: aes128-cbc, 3des-cbc, des-cbc 2025-07-15 14:21:29,631 - DEBUG - server encrypt: aes128-cbc, 3des-cbc, des-cbc 2025-07-15 14:21:29,631 - DEBUG - client mac: hmac-sha1, hmac-sha1-96, hmac-md5, hmac-md5-96 2025-07-15 14:21:29,631 - DEBUG - server mac: hmac-sha1, hmac-sha1-96, hmac-md5, hmac-md5-96 2025-07-15 14:21:29,631 - DEBUG - client compress: none 2025-07-15 14:21:29,631 - DEBUG - server compress: none 2025-07-15 14:21:29,631 - DEBUG - client lang: <none> 2025-07-15 14:21:29,631 - DEBUG - server lang: <none> 2025-07-15 14:21:29,631 - DEBUG - kex follows: False 2025-07-15 14:21:29,631 - DEBUG - === Key exchange agreements === 2025-07-15 14:21:29,631 - DEBUG - Kex: diffie-hellman-group-exchange-sha1 2025-07-15 14:21:29,631 - DEBUG - HostKey: ssh-rsa 2025-07-15 14:21:29,631 - DEBUG - Cipher: aes128-cbc 2025-07-15 14:21:29,631 - DEBUG - MAC: hmac-sha1 2025-07-15 14:21:29,632 - DEBUG - Compression: none 2025-07-15 14:21:29,632 - DEBUG - === End of kex handshake === 2025-07-15 14:21:29,655 - DEBUG - Got server p (2048 bits) 2025-07-15 14:21:30,462 - DEBUG - kex engine KexGex specified hash_algo <built-in function openssl_sha1> 2025-07-15 14:21:30,462 - DEBUG - Switch to new keys ... 2025-07-15 14:21:30,463 - DEBUG - Adding ssh-rsa host key for 172.17.201.28: b&#39;5e3ca5910d7cce29466ca9634fce6a23&#39; 2025-07-15 14:21:30,486 - DEBUG - userauth is OK 2025-07-15 14:21:30,506 - INFO - Authentication (password) successful! 2025-07-15 14:21:30,507 - DEBUG - [chan 0] Max packet in: 32768 bytes 2025-07-15 14:21:30,528 - DEBUG - [chan 0] Max packet out: 32496 bytes 2025-07-15 14:21:30,528 - DEBUG - Secsh channel 0 opened. 2025-07-15 14:21:30,532 - DEBUG - [chan 0] Sesch channel 0 request ok 2025-07-15 14:21:30,536 - DEBUG - [chan 0] Sesch channel 0 request ok 2025-07-15 14:21:30,536 - DEBUG - write_channel: b&#39;\n&#39; 2025-07-15 14:21:30,638 - DEBUG - read_channel: ****************************************************************************** * Copyright (c) 2004-2013 Hangzhou H3C Tech. Co., Ltd. All rights reserved. * * Without the owner&#39;s prior written consent, * * no decompiling or reverse-engineering shall be allowed. * ****************************************************************************** <CDSL_SW201.28_LBG> 2025-07-15 14:21:30,638 - DEBUG - Pattern found: (to continue|[>\]]) ****************************************************************************** * Copyright (c) 2004-2013 Hangzhou H3C Tech. Co., Ltd. All rights reserved. * * Without the owner&#39;s prior written consent, * * no decompiling or reverse-engineering shall be allowed. * ****************************************************************************** <CDSL_SW201.28_LBG> 2025-07-15 14:21:30,939 - DEBUG - read_channel: <CDSL_SW201.28_LBG> 2025-07-15 14:21:30,939 - DEBUG - Clear buffer detects data in the channel 2025-07-15 14:21:31,540 - DEBUG - read_channel: 2025-07-15 14:21:31,540 - DEBUG - write_channel: b&#39;\n&#39; 2025-07-15 14:21:31,540 - DEBUG - read_channel: 2025-07-15 14:21:31,551 - DEBUG - read_channel: <CDSL_SW201.28_LBG> 2025-07-15 14:21:31,551 - DEBUG - Parenthesis found in pattern. pattern: (>|\]) This can be problemtic when used in read_until_pattern(). You should ensure that you use either non-capture groups i.e. &#39;(?:&#39; or that the parenthesis completely wrap the pattern &#39;(pattern)&#39; 2025-07-15 14:21:31,551 - DEBUG - Pattern found: (>|\]) <CDSL_SW201.28_LBG> 2025-07-15 14:21:31,852 - DEBUG - read_channel: 2025-07-15 14:21:31,852 - DEBUG - [find_prompt()]: prompt is <CDSL_SW201.28_LBG> 2025-07-15 14:21:31,852 - DEBUG - In disable_paging 2025-07-15 14:21:31,852 - DEBUG - Command: screen-length disable 2025-07-15 14:21:31,852 - DEBUG - write_channel: b&#39;screen-length disable\n&#39; 2025-07-15 14:21:31,852 - DEBUG - read_channel: 2025-07-15 14:21:31,863 - DEBUG - read_channel: s 2025-07-15 14:21:31,874 - DEBUG - read_channel: 2025-07-15 14:21:31,885 - DEBUG - read_channel: creen-length disable 2025-07-15 14:21:31,896 - DEBUG - read_channel: 2025-07-15 14:21:31,907 - DEBUG - read_channel: ^ % Unrecognized command found at &#39;^&#39; position. <CDSL_SW201.28_LBG> 2025-07-15 14:21:31,907 - DEBUG - Pattern found: (CDSL_SW201\.28_LBG) screen-length disable ^ % Unrecognized command found at &#39;^&#39; position. <CDSL_SW201.28_LBG 2025-07-15 14:21:31,907 - DEBUG - screen-length disable ^ % Unrecognized command found at &#39;^&#39; position. <CDSL_SW201.28_LBG 2025-07-15 14:21:31,907 - DEBUG - Exiting disable_paging 2025-07-15 14:21:31,907 - INFO - 成功连接 172.17.201.28 2025-07-15 14:21:31,907 - DEBUG - write_channel: b&#39;screen-length disable\n&#39; 2025-07-15 14:21:32,008 - DEBUG - read_channel: screen-length disable ^ % Unrecognized command found at &#39;^&#39; position. <CDSL_SW201.28_LBG> 2025-07-15 14:21:32,108 - DEBUG - read_channel: 2025-07-15 14:21:34,109 - DEBUG - read_channel: 2025-07-15 14:21:34,610 - DEBUG - write_channel: b&#39;system-view\n&#39; 2025-07-15 14:21:34,711 - DEBUG - read_channel: system-view ^ % Unrecognized command found at &#39;^&#39; position. <CDSL_SW201.28_LBG> 2025-07-15 14:21:34,812 - DEBUG - read_channel: 2025-07-15 14:21:36,813 - DEBUG - read_channel: 2025-07-15 14:21:37,814 - INFO - 172.17.201.28 是 H3C V5 交换机,使用特殊绑定流程 2025-07-15 14:21:37,814 - DEBUG - write_channel: b&#39;display mac-address 6c0b-5e47-7f89\n&#39; 2025-07-15 14:21:37,915 - DEBUG - read_channel: display mac-address 6c0b-5e47-7f89 ^ % Unrecognized command found at &#39;^&#39; position. <CDSL_SW201.28_LBG> 2025-07-15 14:21:38,016 - DEBUG - read_channel: 2025-07-15 14:21:40,018 - DEBUG - read_channel: 2025-07-15 14:21:40,018 - INFO - MAC地址查询结果: ^ % Unrecognized command found at &#39;^&#39; position. 2025-07-15 14:21:40,018 - ERROR - 在 172.17.201.28 上未找到 MAC 6c0b-5e47-7f89 对应的端口 2025-07-15 14:21:40,019 - DEBUG - write_channel: b&#39;\n&#39; 2025-07-15 14:21:40,120 - DEBUG - read_channel: <CDSL_SW201.28_LBG> 2025-07-15 14:21:40,221 - DEBUG - read_channel: 2025-07-15 14:21:42,222 - DEBUG - read_channel: 2025-07-15 14:21:42,222 - DEBUG - write_channel: b&#39;quit\n&#39; 2025-07-15 14:21:42,222 - DEBUG - EOF in transport thread
最新发布
07-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值