Bug #1492 mysqld_safe does not have a bind-address option

Submitted: 6 Oct 2003 13:49 Modified: 11 Oct 2003 13:33
Reporter: Brian O'Kelley Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.15 OS:Linux (Linux)
Assigned to: Sergei Golubchik CPU Architecture:Any

[6 Oct 2003 13:49] Brian O'Kelley
Description:
My server has multiple network interfaces. When mysql is started via mysqld_safe, it binds to only the loopback interface.

I can get it to bind to the IP address when I use the --bind-address= option, but mysqld_safe doesn't support that (only mysqld).

How to repeat:
# mysqld_safe

# telnet localhost 3306
Trying 192.168.1.3...
telnet: Unable to connect to remote host: Connection refused

# mysqladmin shutdown

# /usr/sbin/mysqld --bind-address=192.168.1.3

... works

Suggested fix:
1) Make mysql bind to all interfaces
2) Add --bind-address option to mysqld_safe
[11 Oct 2003 11:44] MySQL Verification Team
Hmm, I assume when I do:

# telnet localhost 3306

localhost == loopback interface

so:
miguel@hegel:~/dbs/mysql-4.0/bin> ./mysqld_safe --defaults-file=/home/miguel/dbs/mysql-4.0/my.cnf --bind-address=192.168.0.75
Starting mysqld daemon with databases from /home/miguel/dbs/mysql-4.0/var/

miguel@hegel:~> telnet 192.168.0.75 3306
Trying 192.168.0.75...
Connected to 192.168.0.75.
Escape character is '^]'.

What do you think Sergei.
[11 Oct 2003 13:33] Sergei Golubchik
I cannot repeat it.

Instead I see that
1) mysqld binds to all interfaces by default:

% mysqld_safe
% mysql -h 10.3.4.5
ERROR 1130: Host 'serg' is not allowed to connect to this MySQL server
% mysql -h 217.229.113.4
ERROR 1130: Host 'pD9E57104.dip.t-dialin.net' is not allowed to connect to this MySQL server

so, mysql command line client got reply on both interfaces.

2) mysqld_safe passes all unknown options to mysqld, --bind-address included:

% mysqld_safe --bind-address=10.3.4.5
% mysql -h 10.3.4.5
ERROR 1130: Host '10.3.4.5' is not allowed to connect to this MySQL server
% mysql -h 217.229.113.4
ERROR 2003: Can't connect to MySQL server on '217.229.113.4' (60)

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.