Skip to content

Commit

Permalink
Merge pull request #2503 from liuliaozhong/3.7.x_issue_1992-1
Browse files Browse the repository at this point in the history
fix: 目标机器上用Docker拉起MySQL同时监听IPv4与IPv6端口后SQL脚本执行异常 #1992
  • Loading branch information
jsonwan authored Oct 10, 2023
2 parents 9b51d2c + 0fdbc87 commit 9276018
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ timeSec=`date +'%s'`
LOG=/tmp/result_${SCRIPT_NAME}_${timeSec}.log

if [ ${PORT} -gt 0 ]; then
HOST_AND_PORT=`netstat -ntl | grep ":${PORT} " | awk '{print $4}'`
HOST_AND_PORT=`netstat -ntl | grep ":${PORT} " | awk '{print $4}' | head -n 1`
HOST=${HOST_AND_PORT%:${PORT}}
if [ ${HOST} = '0.0.0.0' -o ${HOST} = '::' ];then
HOST='127.0.0.1'
Expand Down

0 comments on commit 9276018

Please sign in to comment.