Bug #75286 | server accepts garbage port | ||
---|---|---|---|
Submitted: | 22 Dec 2014 12:23 | Modified: | 22 Dec 2014 14:56 |
Reporter: | Peter Laursen (Basic Quality Contributor) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Options | Severity: | S3 (Non-critical) |
Version: | 5.7.5, 5.6.22 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[22 Dec 2014 12:23]
Peter Laursen
[22 Dec 2014 14:02]
MySQL Verification Team
Hello Peter Laursen, Thank you for the report. Observed this behavior with 5.6.22 release build. Thanks, Umesh
[22 Dec 2014 14:04]
MySQL Verification Team
// port conf [root@cluster-repo mysql-advanced-5.6.22]# cat /etc/my.cnf|grep port port=562201 // Restart mysqld [root@cluster-repo mysql-advanced-5.6.22]# /etc/init.d/mysqld restart Stopping mysqld: [ OK ] Starting mysqld: [ OK ] // Extract from error log 2014-12-24 20:02:19 28714 [Note] IPv6 is available. 2014-12-24 20:02:19 28714 [Note] - '::' resolves to '::'; 2014-12-24 20:02:19 28714 [Note] Server socket created on IP: '::'. 2014-12-24 20:02:19 28714 [Note] Event Scheduler: Loaded 0 events 2014-12-24 20:02:19 28714 [Note] /usr/sbin/mysqld: ready for connections. Version: '5.6.22-log' socket: '/var/lib/mysql/mysql.sock' port: 562201 MySQL Community Server (GPL) // Check the port on which it is listening // So, may be that huge value must have wrapped around 64k a few times? [root@cluster-repo mysql-advanced-5.6.22]# netstat -apn | grep mysqld tcp 0 0 :::37913 :::* LISTEN 28714/mysqld unix 2 [ ACC ] STREAM LISTENING 10579056 28714/mysqld /var/lib/mysql/mysql.sock // connecting with port 37913/562201 [root@cluster-repo mysql-advanced-5.6.22]# mysql -u root -p --protocol=tcp --port=37913 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.6.22-log MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 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. [(none)]> show variables like 'port'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | port | 562201 | +---------------+--------+ 1 row in set (0.00 sec) [(none)]> \q Bye [root@cluster-repo mysql-advanced-5.6.22]# mysql -u root -p --protocol=tcp --port=562201 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.6.22-log MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 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. [(none)]> show variables like 'port'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | port | 562201 | +---------------+--------+ 1 row in set (0.00 sec) #### from remotely [yyyyyyy@xxxxx]/export/umesh/mysql-5.6.22: bin/mysql -hx.x.x.x -u ushastry -p --port=562201 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.6.22-log MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 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 variables like 'port'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | port | 562201 | +---------------+--------+ 1 row in set (0.28 sec) mysql> \q Bye [yyyyyyy@xxxxx]/export/umesh/mysql-5.6.22: bin/mysql -hx.x.x.x -u ushastry -p --port=37913 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.6.22-log MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 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 variables like 'port'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | port | 562201 | +---------------+--------+ 1 row in set (0.28 sec) mysql>
[22 Dec 2014 14:22]
Peter Laursen
The question is, if it is a recent issue/phenomenon?
[22 Dec 2014 14:39]
MySQL Verification Team
// Similar behavior with 5.1.73 [root@cluster-repo mysql-5.1.73]# netstat -apn | grep mysqld tcp 0 0 0.0.0.0:37913 0.0.0.0:* LISTEN 29768/mysqld unix 2 [ ACC ] STREAM LISTENING 10580923 29768/mysqld /tmp/mysql.sock // Localhost [root@cluster-repo mysql-5.1.73]# bin/mysql -u root -p --protocol=tcp --port=37913 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.1.73 MySQL Community Server (GPL) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 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. [(none)]> show variables like 'port'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | port | 562201 | +---------------+--------+ 1 row in set (0.00 sec) [(none)]> \q Bye [root@cluster-repo mysql-5.1.73]# bin/mysql -u root -p --protocol=tcp --port=37913 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.1.73 MySQL Community Server (GPL) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 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. [(none)]> GRANT ALL ON *.* TO 'ushastry'@'%'; Query OK, 0 rows affected (0.00 sec) [(none)]> // remotely bin/mysql -hx.x.x.x -u ushastry -p --port=37913 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.1.73 MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 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 variables like 'port'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | port | 562201 | +---------------+--------+ 1 row in set (0.28 sec) mysql> bin/mysql -hx.x.x.x -u ushastry -p --port=562201 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 5.1.73 MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. 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 variables like 'port'; +---------------+--------+ | Variable_name | Value | +---------------+--------+ | port | 562201 | +---------------+--------+ 1 row in set (0.28 sec) mysql>
[22 Dec 2014 14:56]
Peter Laursen
Ok .. so this is not new. The problem is that if a port > 64K is specified, it (as I understand it) wraps around 64K as many times as possible and uses the modulus (remains from last wrap possible). This may very well cause conflicts with another program or the system itself. Also note that I cannot connect to the server on Windows on the specified port, like you can on Lnux.