Bug #29626 --with-tcp-port does not change the default port that mysqld runs as
Submitted: 8 Jul 2007 16:13 Modified: 8 Jul 2007 16:34
Reporter: Mark Leith Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version: OS:Any
Assigned to: CPU Architecture:Any

[8 Jul 2007 16:13] Mark Leith
Description:
Compiling with a value for --with-tcp-port other than 3306 does not change the port that the mysqld server starts as without defaults.

For instance, compiling with:

[markleith@medusa:~/mysql/mysql-5.0-bk] $ ./configure --prefix=/Users/markleith/mysql/mysql-5.0-newport --with-tcp-port=3770 --without-docs --without-man  --without-bench

Looking at mysql_config, mysql_version.h, the example my.cnf files etc, these are all set to 3770:

[markleith@medusa:~/mysql/mysql-5.0-newport] $ ./bin/mysql_config 
Usage: ./bin/mysql_config [OPTIONS]
Options:
        --cflags         [-I/Users/markleith/mysql/mysql-5.0-newport/include/mysql]
        --include        [-I/Users/markleith/mysql/mysql-5.0-newport/include/mysql]
        --libs           [-L/Users/markleith/mysql/mysql-5.0-newport/lib/mysql -lmysqlclient -lz -lm]
        --libs_r         [-L/Users/markleith/mysql/mysql-5.0-newport/lib/mysql -lmysqlclient_r -lz -lm]
        --socket         [/tmp/mysql.sock]
        --port           [3770]
        --version        [5.0.46]
        --libmysqld-libs [-L/Users/markleith/mysql/mysql-5.0-newport/lib/mysql -lmysqld -lz -lm]

[markleith@medusa:~/mysql/mysql-5.0-newport] $ grep -i port ./include/mysql/mysql_version.h 
#define MYSQL_PORT                      3770

[markleith@medusa:~/mysql/mysql-5.0-newport] $ grep -i port 
../mysql-5.0-bk/support-files/my-huge.cnf:port          = 3770
../mysql-5.0-bk/support-files/my-huge.cnf:port          = 3770
....

But if I start the server, with --no-defaults, or just without any defaults file etc. - the server still starts on 3306:

[markleith@medusa:~/mysql/mysql-5.0-newport] $ ./libexec/mysqld &
[2] 27825
[markleith@medusa:~/mysql/mysql-5.0-newport] $ 070708 17:11:14 [Warning] Setting lower_case_table_names=2 because file system for /Users/markleith/mysql/mysql-5.0-newport/var/ is case insensitive
070708 17:11:14 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=/Users/markleith/mysql/mysql-5.0-newport/var/medusa-bin' to avoid this problem.
070708 17:11:14  InnoDB: Started; log sequence number 0 43655
070708 17:11:14 [Note] ./libexec/mysqld: ready for connections.
Version: '5.0.46-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution

How to repeat:
Compile with a value for --with-tcp-port other than 3306, use any of the above to confirm that the server does not start with the configured port.
[8 Jul 2007 16:34] Mark Leith
closing as duplicate of bug #15327