免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 39625 | 回复: 0
打印 上一主题 下一主题

让人崩溃的bug: scripts/mysql_install_db: ./bin/my_print_defaults: not found [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-11-05 13:53 |只看该作者 |倒序浏览
本帖最后由 starive 于 2014-11-05 14:25 编辑

本人下载了MySQL cluster 7.3.7 (下载地址:http://dev.mysql.com/downloads/cluster/) 二进制版本。本人参考博客:http://blog.itpub.net/26230597/viewspace-1087713/ 进行安装,目前已经在管理节点和数据节点安装好了Cluster。但是在 SQL节点上安装Cluster就出现了问题。


SQL 节点安装步骤如下:

解压文件
shell>tar -zxvf mysql-cluster-gpl-7.3.7-linux-glibc2.5-i686.tar.gz



拷贝安装文件
shell>mv /home/David/cluster/mysql-cluster-gpl-7.3.7-linux2.6-x86_64  /usr/local/mysql


添加mysql用户
shell>groupadd  mysql
shell>useradd -g mysql mysql


添加权限
shell>chown -R mysql:mysql /usr/local/mysql


拷贝配置文件
shell>cp /usr/local/mysql/support-files/my-default.cnf  /etc/my.cnf



初始化数据库
shell>cd /usr/local/mysql
shell>scripts/mysql_install_db --user=mysql

报错:
sh: 1: ./bin/my_print_defaults: not found
FATAL ERROR: Neither host 'ubuntu' 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


本人采用了如下方法来解决:
解决方法1
查看 /etc/hosts, 其内容如下:
127.0.0.1 localhost
127.0.1.1 ubuntu

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

127.0.0.1 localhost,localhost.localdomain
172.3.200.159 localhost,localhost.locqaldomain

完全符合网上所说“要添加 127.0.0.1 localhost到/etc/hosts文件中“。最后一行”172.3.200.159“是本人的ip地址。



解决方法2
修改 ~/.bashrc文件的内容:

vi ~/.bashrc
export PATH=/usr/local/mysql/binPATH
source ~/.bashrc
重新启动机器,重新执行命令:scripts/mysql_install_db --user=mysql  
出现了如下错误:
FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.

If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

又参考网页: http://blog.sina.com.cn/s/blog_546cc4350101g1pj.html
执行命令:/usr/local/mysql/scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data &

又出现error:  
root@ubuntu:/usr/local/mysql/bin# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data &
[1] 2264
root@ubuntu:/usr/local/mysql/bin# sh: 1: /usr/local/mysql/bin/my_print_defaults: not found
FATAL ERROR: Neither host 'ubuntu' nor 'localhost' could be looked up with
/usr/local/mysql/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


采用以上两种方法,仍然无法解决问题,到底该如何解决了???

本人仔细看了博客http://blog.itpub.net/26230597/viewspace-1087713/的安装方法,和博客的方法只有以下两个区别:
区别:
博客是 mysql-cluster-gpl-7.2.4-linux2.6-x86_64.tar.gz
我的是 mysql-cluster-gpl-7.3.7-linux-glibc2.5-i686.tar.gz
一个64位,一个32位
博客的是 linux2.6, 我的是linux-glibc2.5


其实,这个问题在这台机器(后面简称主机C)上不是第一次出现了。因为我要搭建mysql集群,所以首先在 三台机器上面都安装上了mysql。不过安装环境有区别: 主机A的环境是:Win7下的VirtualBox + Ubuntu + MySQL, 主机B的环境是:Win7下的VirtualBox + Ubuntu + MySQL, 主机C的环境是:Ubuntu系统 + MySQL。主机C的系统直接在机器上面安装的,不是虚拟环境,安装方法:wubi安装。

最开始在三台主机分别安装MySQL时,主机A和主机B都能顺利安装,但是主机C上面安装有问题,出现的问题跟现在搭建cluster的问题一模一样(详见我发布的帖子: http://www.itpub.net/thread-1894039-1-1.html

为什么每次在主机C上面执行 scripts/mysql_install_db --user=mysql, 都会出现这种错误了,难道是因为我直接安装Ubuntu的原因吗,还是Wubi安装带来的bug??? 这个难题都困恼我半个月了,在stackoverflow,itpub和csdn上面都没有人能解答???



请告诉帮忙解答,谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP