Bug #12409 compiling mysql-4.0.25 with the option --with-tcp-port=3307 not functional
Submitted: 6 Aug 2005 4:50 Modified: 25 Oct 2005 17:29
Reporter: Yashesh Bhatia Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.25 OS:Linux (Linux)
Assigned to: Bugs System CPU Architecture:Any

[6 Aug 2005 4:50] Yashesh Bhatia
Description:
I downloaded the following file
[root@bfc11 mysql]# ls -l mysql-4.0.25.tar.gz
-rw-r--r--  1 root root 11159288 Jul 26 13:29 mysql-4.0.25.tar.gz

for doing a source install of mysql 4.0.25

i did the following steps for installation

[root@bfc11 mysql]# pwd
/staging/src/mysql
[root@bfc11 mysql]# tar -xzf mysql-4.0.25.tar.gz

[root@bfc11 mysql-4.0.25]# ./configure --prefix=/staging/mysql-4.0.25 --with-unix-socket-path=/tmp/mysql-4.0.25.sock --with-tcp-port=3307

please note - am using different values for the socket and tcp-port.

[root@bfc11 mysql-4.0.25]# make
[root@bfc11 mysql-4.0.25]# make install
[root@bfc11 mysql-4.0.25]# cd /staging/mysql-4.0.25/
[root@bfc11 mysql-4.0.25]# bin/mysql_install_db --user=mysql
[root@bfc11 mysql-4.0.25]# chown -R root  .
[root@bfc11 mysql-4.0.25]# chown -R mysql var
[root@bfc11 mysql-4.0.25]# chgrp -R mysql .
[root@bfc11 mysql-4.0.25]# bin/mysqld_safe --user=mysql &
[1] 11058
[root@bfc11 mysql-4.0.25]# Starting mysqld daemon with databases from /staging/mysql-4.0.25/var
 
[root@bfc11 mysql-4.0.25]# cat var/bfc11.err
050806 10:16:19  mysqld started
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
050806 10:16:19  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
050806 10:16:20  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
050806 10:16:20  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
050806 10:16:21  InnoDB: Started
/staging/mysql-4.0.25/libexec/mysqld: ready for connections.
Version: '4.0.25'  socket: '/tmp/mysql-4.0.25.sock'  port: 3306  Source distribution
[root@bfc11 mysql-4.0.25]#

The above log shows the socket is used correctly (/tmp/mysql-4.0.25.sock) however it's not using the port 3307

I checked the entire disk for presence of a my.cnf file
[root@bfc11 /]# pwd
/
[root@bfc11 /]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
[root@bfc11 /]# find . -name my.cnf
[root@bfc11 /]#

and it's not present. 

How to repeat:
repeat the above steps.

Suggested fix:
use a my.cnf file and specify the port number.
[7 Aug 2005 11:14] Aleksey Kishkin
after configure with --with-tcp-port=3307, built and checked:

hnt02951:/tmp/mysql-4.0.25 # libexec/mysqld --no-defaults --user=mysql
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
050807 15:11:18  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
050807 15:11:18  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
050807 15:11:18  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
050807 15:11:20  InnoDB: Started
libexec/mysqld: ready for connections.
Version: '4.0.25'  socket: '/tmp/mysql-4.0.25.sock'  port: 3306  Source distribution

So, with option --no-defaults (do not read any .cnf files)  mysql listens 3306 port.
[25 Oct 2005 17:29] Patrick Galbraith
Upgrade to 4.1. This works in 4.1, and 4.0 is in maintenance mode, only high priority fixes will be fixed.