Reputation: 3178
I have downloaded the mysql-5.1.38-linux-x86_64-glibc23.tar.gz from here
and then i have executed it by using below command
groupadd mysql
useradd -g mysql mysql123
cp mysql-5.1.38-linux-x86_64-glibc23.tar.gz /home /mysql123/
su - mysql123
tar -zxvf mysql-5.1.38-linux-x86_64-glibc23.tar.gz
mv mysql-5.1.38-linux-x86_64-glibc23 mysql
mkdir tmp
cd mysql/
mv suppport-files/my-medium.cnf my.cnf
cp support-files/mysql.server bin/
and then i have edited the my.cnf and set the basedir and datadir to /home/mysql123/mysql and /home/mysql123/mysql/data and innodb_home_dir and logfile directory to datadir
Now edited mysql.server and set the datadir and basedir in them properly
and then initiated mysql_install_db as
[mysql123@localhost mysql]$ ./scripts/mysql_install_db
./scripts/mysql_install_db: line 244: ./bin/my_print_defaults: cannot execute binary file
Neither host '127.0.0.1' 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
on seeing the error i thought it may be confused with basedir and executed the same as below
[mysql123@localhost mysql]$ ./scripts/mysql_install_db -–user=mysql123 -–basedir=/home/mysql123/mysql
./scripts/mysql_install_db: line 244: ./bin/my_print_defaults: cannot execute binary file
Neither host '127.0.0.1' 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 am not gettin what is going internally and showing this kind of message
and i am sure that i have enough diskspace ( df -h ) and i have proper ownership ( chown mysq123:mysql /home/mysql123/ -R) and proper permissions ( chmod 755 .)
and the lines in mysql_install_db are like below
please any help to solve this problem is very useful ( and i have to follow the same installation process)
i am using redhat 6
Upvotes: 10
Views: 16425
Reputation: 107
I also ran into this issue simply because there was a discrepancy in my CNF file: the basedir was not set to my $MYSQL_HOME.
Upvotes: 0
Reputation: 44
Neither host '127.0.0.1' nor 'localhost' could be looked up with ./bin/resolveip
Just add string in /etc/hosts
Upvotes: 1
Reputation: 9649
I had this same problem and it was due to installing a 32bit MySQL in a 64bit system. That became obvious when I ran ./bin/resolveip
and it said
bash: ./bin/resolveip: No such file or directory
Despite it existing and being executable.
Solution was to change to using a 64bit mysql. In your case it would seem you need to try the opposite - try 32bit instead.
Upvotes: 0
Reputation: 329
Please execute below steps to resolve your ip Address.
vi /etc/sysconfig/network
HOSTNAME=mybox
vi /etc/hosts
10.103.14.112 mybox.example.com mybox
/usr/bin/resolveip 10.103.14.112
logout from the box and login again.
It works fine.
Give a try.
Upvotes: 0
Reputation: 111
Based on your prompt which identifies your host as 'localhost' in your screen shots it would appear that the program is designed to not accept that as a valid hostname.
Please change your hostname to something other than 'localhost'.
"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"
Alternately, the above message suggests you can use the --force option to over ride this. But having a sensible hostname seems like the better path.
-HTH
Upvotes: 0