Bug #51369 Mac OSX install with error unknown variable 'max_connections = 150'
Submitted: 21 Feb 2010 15:56 Modified: 4 Mar 2010 15:39
Reporter: Bernard Leung Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.1.44 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: osx install error max_connections aborting

[21 Feb 2010 15:56] Bernard Leung
Description:
Hi All, 

When I install using both the installer (DMG) as well as the tar.gz file, when I run the mysql_install_db command I get the following. 

MrBernz:mysql bernardleung$ sudo ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
100221 15:03:36 [Warning] ./bin/mysqld: Option '--set-variable' is deprecated. Use --variable-name=value instead.
100221 15:03:36 [Warning] The syntax '--skip-locking' is deprecated and will be removed in a future release. Please use --skip-external-locking instead.
100221 15:03:36 [ERROR] ./bin/mysqld: unknown variable 'max_connections = 150'
100221 15:03:36 [ERROR] Aborting

100221 15:03:36 [Note] ./bin/mysqld: Shutdown complete

Installation of system tables failed!  Examine the logs in
./data for more information.

You can try to start the mysqld daemon with:

    shell> ./bin/mysqld --skip-grant &

and use the command line tool ./bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> ./bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in ./data that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com/.  Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the ./bin/mysqlbug script!

Firstly is it normal that I have to run this command under su? If I don't I get a "permission denied" error when trying to write/create the /usr/local/mysql/data directory and files within that directory. 

Secondly is the aborting of the install normal?? Judging from the error message it doesn't seem correct...

Thanks!

Bernard

How to repeat:
Download the mysql 5.1.44 version for OSX. 

Install using the installer

Run the following command
"sudo ./scripts/mysql_install_db --user=mysql"
[21 Feb 2010 16:01] Valeriy Kravchuk
Do you have any old my.cnf somewhere in the system? Please, check with the following command in the terminal:

find / -name my.cnf -print 2>/dev/null
[21 Feb 2010 18:00] Bernard Leung
Yep got a few. Results of that search is: -
/usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/federated/my.cnf
/usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/ndb/my.cnf
/usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/rpl/my.cnf
/usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf

Content of those are: -
MrBernz:~ bernardleung$ less /usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/federated/my.cnf
# Use default setting for mysqld processes
!include include/default_mysqld.cnf

[mysqld.1]
log-bin=                 master-bin

[mysqld.2]

[ENV]
MASTER_MYPORT=           @mysqld.1.port
MASTER_MYSOCK=           @mysqld.1.socket

SLAVE_MYPORT=            @mysqld.2.port
SLAVE_MYSOCK=            @mysqld.2.socket

MrBernz:~ bernardleung$ less /usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/ndb/my.cnf
!include include/default_mysqld.cnf
!include include/default_ndbd.cnf

[cluster_config.1]
NoOfReplicas=                  2
ndbd=,
ndb_mgmd=
mysqld=,

[mysqld]
# Make all mysqlds use cluster
ndbcluster

[ENV]
NDB_CONNECTSTRING=             @mysql_cluster.1.ndb_connectstring
MASTER_MYSOCK=                 @mysqld.1.1.socket
MASTER_MYPORT=                 @mysqld.1.1.port
MASTER_MYPORT1=                @mysqld.2.1.port

NDB_BACKUP_DIR=                @cluster_config.ndbd.1.1.BackupDataDir

MrBernz:~ bernardleung$ less /usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/rpl/my.cnf
# Use settings from rpl_1slave_base.cnf
# add setting to connect the slave to the master by default
!include rpl_1slave_base.cnf

[mysqld.2]
# Hardcode the host to 127.0.0.1 until running on more
# than one host and it need to be masked
# master-host=              @mysqld.1.#host
master-host=              127.0.0.1
master-port=              @mysqld.1.port
master-password=          @mysqld.1.#password
master-user=              @mysqld.1.#user
master-connect-retry=     1

MrBernz:~ bernardleung$ less /usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf
!include include/default_mysqld.cnf
!include include/default_ndbd.cnf

[cluster_config.1]
NoOfReplicas=                  2
ndbd=,
ndb_mgmd=
mysqld=,

[cluster_config.slave]
NoOfReplicas=                  1
ndbd=
ndb_mgmd=
mysqld=

[mysqld]
# Make all mysqlds use cluster
ndbcluster
# Turn on bin logging
log-bin=                       master-bin

[mysqld.1.1]

[mysqld.1.1]

[mysqld.1.slave]

# Append <testname>-slave.opt file to the list of argument used when
# starting the mysqld
#!use-slave-opt

# Connect mysqld in the second cluster as save to  first mysqld
# Hardcode the host to 127.0.0.1 until running on more
# than one host and it probably need to be masked anyway
# master-host=                @mysqld.1.#host
master-host=                  127.0.0.1
master-port=                  @mysqld.1.1.port
master-password=              @mysqld.1.1.#password
master-user=                  @mysqld.1.1.#user
master-connect-retry=         1

log-bin=                      slave-bin
relay-log=                    slave-relay-bin

init-rpl-role=                slave
log-slave-updates
master-retry-count=           10

# Values reported by slave when it connect to master
# and shows up in SHOW SLAVE STATUS;
report-host=                  127.0.0.1
report-port=                  @mysqld.1.slave.port
report-user=                  root

loose-skip-innodb
skip-slave-start

# Directory where slaves find the dumps generated by "load data"
# on the server. The path need to have constant length otherwise
# test results will vary, thus a relative path is used.
slave-load-tmpdir=            ../../../tmp

rpl-recovery-rank=            @mysqld.1.slave.server-id

[ENV]
NDB_CONNECTSTRING=            @mysql_cluster.1.ndb_connectstring
MASTER_MYPORT=                @mysqld.1.1.port
MASTER_MYPORT1=               @mysqld.2.1.port

NDB_CONNECTSTRING_SLAVE=      @mysql_cluster.slave.ndb_connectstring
SLAVE_MYPORT=                 @mysqld.1.slave.port
SLAVE_MYSOCK=                 @mysqld.1.slave.socket

NDB_BACKUP_DIR=               @cluster_config.ndbd.1.1.BackupDataDir

Does this help??
[21 Feb 2010 19:04] Valeriy Kravchuk
No, these should be used only for servers started by the test suite. Do you have .my.cnf somewhere maybe? Check with

find / -name .my.cnf -print 2>/dev/null
[21 Feb 2010 22:01] Bernard Leung
No, no .my.cnf file.
[22 Feb 2010 12:33] Valeriy Kravchuk
Are you really sure that with .tar.gz this problem happens? Look:

77-52-24-143:5.1 openxs$ cd ../mysql-5.1.44-osx10.5-x86
77-52-24-143:mysql-5.1.44-osx10.5-x86 openxs$ scripts/mysql_install_db 
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h 77-52-30-21.dialup.umc.net.ua password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/

77-52-24-143:mysql-5.1.44-osx10.5-x86 openxs$ bin/mysqld_safe &
[1] 97832
77-52-24-143:mysql-5.1.44-osx10.5-x86 openxs$ 100222 14:26:42 mysqld_safe Logging to '/Users/openxs/dbs/mysql-5.1.44-osx10.5-x86/data/77-52-30-21.dialup.umc.net.ua.err'.
chown: /Users/openxs/dbs/mysql-5.1.44-osx10.5-x86/data/77-52-30-21.dialup.umc.net.ua.err: Operation not permitted
100222 14:26:42 mysqld_safe Starting mysqld daemon with databases from /Users/openxs/dbs/mysql-5.1.44-osx10.5-x86/data

77-52-24-143:mysql-5.1.44-osx10.5-x86 openxs$ bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.44 MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables like 'max_c%';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| max_connect_errors | 10    |
| max_connections    | 151   |
+--------------------+-------+
2 rows in set (0.01 sec)
[22 Feb 2010 20:11] Bernard Leung
Absolutely, unless I"m meant to run the commands as "mysql" user - in which case I don't know what the password is to su into mysql?? If I run exactly as you have this is what I get: -

MrBernz:local bernardleung$ cd /usr/local/mysql-5.1.44-osx10.5-x86/
MrBernz:mysql-5.1.44-osx10.5-x86 bernardleung$ ./scripts/mysql_install_db 
mkdir: ./data/mysql: Permission denied
chmod: ./data/mysql: Permission denied
mkdir: ./data/test: Permission denied
chmod: ./data/test: Permission denied
Installing MySQL system tables...
100222 20:08:58 [Warning] ./bin/mysqld: Option '--set-variable' is deprecated. Use --variable-name=value instead.
100222 20:08:58 [Warning] The syntax '--skip-locking' is deprecated and will be removed in a future release. Please use --skip-external-locking instead.
100222 20:08:58 [Warning] Can't create test file /usr/local/mysql-5.1.44-osx10.5-x86/data/MrBernz.lower-test
100222 20:08:58 [Warning] Can't create test file /usr/local/mysql-5.1.44-osx10.5-x86/data/MrBernz.lower-test
./bin/mysqld: Can't change dir to '/usr/local/mysql-5.1.44-osx10.5-x86/data/' (Errcode: 13)
100222 20:08:58 [ERROR] Aborting

100222 20:08:58 [Note] ./bin/mysqld: Shutdown complete

Installation of system tables failed!  Examine the logs in
./data for more information.

You can try to start the mysqld daemon with:

    shell> ./bin/mysqld --skip-grant &

and use the command line tool ./bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> ./bin/mysql -u root mysql
    mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log
gives you a log in ./data that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com/.  Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS.  Another information source are the
MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us!  And remember, if
you do mail us, you MUST use the ./bin/mysqlbug script!

the mysql directory looks as follows: -
MrBernz:mysql-5.1.44-osx10.5-x86 bernardleung$ ls -la
total 216
drwxr-xr-x@ 18 root    _mysql    612 21 Feb 15:00 .
drwxr-xr-x   9 root    wheel     306 21 Feb 15:02 ..
-rw-r--r--@  1 root    _mysql  19071  5 Feb 22:24 COPYING
-rw-r--r--@  1 root    _mysql   5139  5 Feb 22:24 EXCEPTIONS-CLIENT
-rw-r--r--@  1 root    _mysql   9439  5 Feb 22:24 INSTALL-BINARY
-rw-r--r--@  1 root    _mysql  62989  5 Feb 22:24 README
drwxr-xr-x@ 46 root    _mysql   1564  5 Feb 22:24 bin
drwxr-x---   9 _mysql  _mysql    306 21 Feb 15:42 data
drwxr-xr-x@  4 root    _mysql    136  5 Feb 22:23 docs
drwxr-xr-x@ 34 root    _mysql   1156  5 Feb 22:23 include
drwxr-xr-x@ 22 root    _mysql    748  5 Feb 22:24 lib
drwxr-xr-x@  4 root    _mysql    136  5 Feb 22:23 man
lrwxr-xr-x   1 root    _mysql      5 21 Feb 15:00 mysql -> mysql
drwxr-xr-x@ 15 root    _mysql    510  5 Feb 22:24 mysql-test
drwxr-xr-x@  3 root    _mysql    102  5 Feb 22:24 scripts
drwxr-xr-x@ 35 root    _mysql   1190  5 Feb 22:24 share
drwxr-xr-x@ 29 root    _mysql    986  5 Feb 22:24 sql-bench
drwxr-xr-x@ 16 root    _mysql    544  5 Feb 22:24 support-files

Does this look normal to you??

Bernard
[4 Mar 2010 10:46] Sveta Smirnova
Thank you for the feedback.

This is very strange you get such errors having no configuration files around. Please try `sudo find / -name *my.cnf -print 2>/dev/null` to be sure this is not configuration file belongs to root user.
[4 Mar 2010 11:21] Bernard Leung
Ok did that, this is what I have. 

mrbernz:~ bernardleung$ find / -name *my.cnf -print 2> /dev/null
/private/etc/my.cnf
/usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/include/default_my.cnf
/usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/federated/my.cnf
/usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/ndb/my.cnf
/usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/rpl/my.cnf
/usr/local/mysql-5.1.44-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf

Does this help?
[4 Mar 2010 11:29] MySQL Verification Team
a workaround to avoid any rogue my.cnf's would be:

./scripts/mysql_install_db --no-defaults
[4 Mar 2010 15:39] Sveta Smirnova
Thank you for the feedback.

> Ok did that, this is what I have. 
>
> mrbernz:~ bernardleung$ find / -name *my.cnf -print 2> /dev/null
> /private/etc/my.cnf
...
> Does this help?

Yes, this helps. You found configuration file, so this is not a MySQL bug.