Bug #44405 ./bin/my_print_defaults:cannot execute binary file
Submitted: 22 Apr 2009 10:30 Modified: 23 Dec 2010 20:31
Reporter: Christine Tang Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:MySQL-5.1.34-linux-i686-glibc23 OS:Linux (Fedora 8)
Assigned to: CPU Architecture:Any

[22 Apr 2009 10:30] Christine Tang
Description:
Hi! 

I downloaded MySQL-5.1.34-linux-i686-glibc23 and I had been trying to install mysql but to no avail. I followed the steps documented in INSTALL-BINARY file up to 

shell> scripts/mysql_install_db --user=mysql

Unfortunately, the error returned was

scripts/mysql_install_db: line 99: ./bin/my_print_defaults: cannot execute binary file
Neither host 'localhost.localdomain' nor 'localhost' could be looked up with ./bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with the --force option

I've tried with --force but it's still not working. I'm installing into my Fedora 8 virtual pc....

Any ideas/solutions to this problem?

How to repeat:
1. Download mysql-5.1.34-linux-i686-glibc23.
2. Extract the package and make a copy to /usr/local.
3. ln -s /usr/local/mysql-5.1.34-linux-i686-glibc23 mysql.
4. cd mysql
5. chown -R mysql .
6. chgrp -R mysql .
7. scripts/mysql_install_db --user=mysql.
[29 Apr 2009 9:30] Sveta Smirnova
Thank you for the report.

Please provide output of hostname command
[30 Apr 2009 3:06] Christine Tang
Hostname returns "localhost.localdomain".
[30 Apr 2009 7:21] Sveta Smirnova
Thank you for the feedback.

Please provided content of /etc/hosts and output of `my_print_defaults` and `resolveip localhost.localdomain` also.
[30 Apr 2009 7:59] Christine Tang
/etc/hosts contain:

127.0.0.1   localhost.localdomain    localhost    localhost
::1       localhost6.localdomain6   localhost6

I can't execute "resolveip localhost.localdomain"
Nevertheless, I obtain the following output when I execute "nslookup localhost.localdomain":

Server:  202.188.0.133
Address: 202.188.0.133#53

Non-authoritative answer: 
Name: localhost.localdomain
Address: 203.106.203.238

I can't execute "my_print_defaults" command. It's not a valid command.
[30 Apr 2009 8:12] Sveta Smirnova
Thank you for the feedback.

> I can't execute "my_print_defaults" command. It's not a valid command.

Just to be sure if you use correct binary. Please provide output of uname -a and indicate if you use 32-bit OS. Also I assume mysql-5.1.34-linux-i686-glibc23 is mysql-5.1.34-linux-i686-glibc23.tar.gz
[30 Apr 2009 8:17] Christine Tang
Output from "uname -a":
Linux 2.6.23.1-42.fc8 i686

Yes, mysql-5.1.34-linux-i686-glibc23 is mysql-5.1.34-linux-i686-glibc23.tar.gz
[14 May 2009 9:53] Sveta Smirnova
Thank you for the feedback.

Please provide output of `resolveip` command also ($PATH_TO+MYSQL_INSTALLATION/bin/resolveip)
[28 May 2009 3:21] Christine Tang
Hi!

I'm not exactly sure what you mean by providing the output of 'resolveip'. There are only few options to this command which is -V, -I, -s and -?. Could you elaborate more what you want me to do?

Thanks!
[28 May 2009 5:12] Sveta Smirnova
Thank you for the feedback.

> I can't execute "my_print_defaults" command. It's not a valid command.

What is the output of PATH_TO_MYSQL_INSTALLATION/bin/my_print_defaults mysqld mysql_install_db?

> I'm not exactly sure what you mean by providing the output of 'resolveip'. 

I mean what outputs PATH_TO_MYSQL_INSTALLATION/bin/resolveip localhost and PATH_TO_MYSQL_INSTALLATION/bin/resolveip localhost.localdomain, so we can be sure this program is not broken
[29 May 2009 9:55] Christine Tang
Hi!

If I get you correctly, output of 
PATH_TO_MYSQL_INSTALLATION/bin/resolveip localhost is 127.0.0.1
and output of
PATH_TO_MYSQL_INSTALLATION/bin/resolveip localhost.localdomain is 203.106.203.238.

Thanks!
[29 May 2009 10:01] Christine Tang
Output of PATH_TO_MYSQL_INSTALLATION/bin/my_print_defaults mysqld
mysql_install_db is 

--datadir=/var/lib/mysql
--socket=/var/lib/mysql/mysql.sock
--user=mysql
--old_passwords=1
[6 Aug 2009 6:57] Sveta Smirnova
Thank you for the feedback.

I still can not repeat described behavior. Please try with current version 5.1.37 and if problem still exists indicate accurate package name you use (file name[s] you downloaded).
[6 Sep 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[30 May 2010 15:06] rodrigo marins
Try!!!
/scripts/mysql_install_db --user=mysql --force
[30 May 2010 16:50] rodrigo marins
Watch also the version of the system and its kernel.
I had a problem with the IA64bits and X86_62, and appeared the same error that you reported.
[23 Dec 2010 5:44] sun yongfeng
Hello,I got the same error when I install both mysql-5.1.53.tar.gz(source) and mysql-5.5.8-linux2.6-i686.tar.gz(binary) on ubuntu 10.10 i386. 

shell> scripts/mysql_install_db --user=mysql
scripts/mysql_install_db: line 99: ./bin/my_print_defaults: cannot execute
binary file
Neither host 'sunnogo' nor 'localhost' could be looked up with
./bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with the --force
option

The content of etc/hosts is correct and output of `my_print_defaults` and `resolveip myhostname` both works well.
I find the resolveip file on my-mysqldir/bin, then i copy it to /usr/bin, re-excute command. Unfortunately, i got another error:

shell> scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
101216 13:33:28 [ERROR] /usr/sbin/mysqld: unknown variable 'lc-messages-dir=/usr/share/mysql/english/..'
101216 13:33:28 [ERROR] Aborting

101216 13:33:28 [Note] /usr/sbin/mysqld: Shutdown complete

Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

    shell> /usr/sbin/mysqld --skip-grant &

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

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

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

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 /usr/scripts/mysqlbug script!

By google, i found not any results by searching "[ERROR] /usr/sbin/mysqld: unknown variable 'lc-messages-dir=/usr/share/mysql/english/..'" but i got lots of results by "mysql installing error unkonwn variable". I took one of the solution which excute the command by adding parament --basedir=/usr/local/my-mysqldir/:

shell> scripts/mysql_install_db --user=mysql --basedir=/usr/local/my-mysqldir/
Installing MySQL system tables...
/usr/local/mysql-5.5.8-linux2.6-i686//bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

    shell> /usr/local/mysql-5.5.8-linux2.6-i686//bin/mysqld --skip-grant &

and use the command line tool /usr/local/mysql-5.5.8-linux2.6-i686//bin/mysql
to connect to the mysql database and look at the grant tables:

    shell> /usr/local/mysql-5.5.8-linux2.6-i686//bin/mysql -u root mysql
    mysql> show tables

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

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 /usr/local/mysql-5.5.8-linux2.6-i686//scripts/mysqlbug script!

Oh, no...another error!
But this error is easy to solve. Just install libaio1(or libaio-dev? i install libaio-dev first then i found libaio1 had already installed).Re-excute the same command:

shell>/usr/local/mysql-5.5.8-linux2.6-i686$ sudo scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql-5.5.8-linux2.6-i686/
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:

/usr/local/mysql-5.5.8-linux2.6-i686//bin/mysqladmin -u root password 'new-password'
/usr/local/mysql-5.5.8-linux2.6-i686//bin/mysqladmin -u root -h sunnogo-ThinkCentre password 'new-password'

Alternatively you can run:
/usr/local/mysql-5.5.8-linux2.6-i686//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 /usr/local/mysql-5.5.8-linux2.6-i686/ ; /usr/local/mysql-5.5.8-linux2.6-i686//bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql-5.5.8-linux2.6-i686//mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/local/mysql-5.5.8-linux2.6-i686//scripts/mysqlbug script!

Hope this would help
[23 Dec 2010 6:00] sun yongfeng
Last comment is too mess...administrator please del it.
Here's the same solution, which is a bit a tidy.

I got the same error when I install both mysql-5.1.53.tar.gz(source) and mysql-5.5.8-linux2.6-i686.tar.gz(binary) on ubuntu 10.10 i386. 

shell> scripts/mysql_install_db --user=mysql
scripts/mysql_install_db: line 99: ./bin/my_print_defaults: cannot execute
binary file
Neither host 'sunnogo' nor 'localhost' could be looked up with
./bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
……

I find the resolveip file on my-mysqldir/bin, then i copy it to /usr/bin, re-excute command. Unfortunately, i got another error:
shell> scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
101216 13:33:28 [ERROR] /usr/sbin/mysqld: unknown variable 'lc-messages-dir=/usr/share/mysql/english/..'
101216 13:33:28 [ERROR] Aborting
101216 13:33:28 [Note] /usr/sbin/mysqld: Shutdown complete
……

By google, i found not any results by searching "[ERROR] /usr/sbin/mysqld: unknown variable 'lc-messages-dir=/usr/share/mysql/english/..'" but i got lots of results by "mysql installing error unkonwn variable". I took one of the solution which excute the command by adding parament --basedir=/usr/local/my-mysqldir/:

shell> scripts/mysql_install_db --user=mysql --basedir=/usr/local/my-mysqldir/
Installing MySQL system tables...
/usr/local/mysql-5.5.8-linux2.6-i686//bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
Installation of system tables failed!  Examine the logs in
/var/lib/mysql for more information.
……

Oh, no...another error!
But this error is easy to solve. Just install libaio1(or libaio-dev? i install libaio-dev first then i found libaio1 had already installed).Re-excute the same command:

shell>/usr/local/mysql-5.5.8-linux2.6-i686$ sudo scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql-5.5.8-linux2.6-i686/
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
……

Hope this would help
[23 Dec 2010 20:31] Sveta Smirnova
Thank you for the feedback.

----<q>----
I got the same error when I install both mysql-5.1.53.tar.gz(source) and
mysql-5.5.8-linux2.6-i686.tar.gz(binary) on ubuntu 10.10 i386. 

shell> scripts/mysql_install_db --user=mysql
scripts/mysql_install_db: line 99: ./bin/my_print_defaults: cannot execute
binary file
Neither host 'sunnogo' nor 'localhost' could be looked up with
./bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
……

I find the resolveip file on my-mysqldir/bin, then i copy it to /usr/bin, re-excute
command. Unfortunately, i got another error:
----</q>----

This means you had resolveip in wrong directory ot mixed resolveip from different versions. Later errors are not result of MySQL bug either.

So closing report as "Not a Bug". Though your comment can help users to solve similar misconfigurations.