查看: 12894|回复: 8

[原创] mysql安装小问题 mysql_install_db: ./bin/my_print_defaults: not found N

[复制链接]
论坛徽章:
6
2014年新春福章
日期:2014-02-18 16:44:08马上有对象
日期:2014-02-18 16:44:08优秀写手
日期:2015-01-13 06:00:15优秀写手
日期:2015-02-12 06:00:142015年新春福章
日期:2015-03-04 14:53:162015年新春福章
日期:2015-03-06 11:58:39
跳转到指定楼层
1#
发表于 2014-10-24 17:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本人在Ubuntu12.04下安装了mysql5.5.39,安装步骤如下,到第 5 步就出bug了,


1:
在/home/*****下创建文件夹mysql:
/home/*****/mysql,

2
/home/*****/mysql/mysql-5.5.39,把压缩包解压到mysql-5.5.39文件夹下,如下图:



3
sudo groupadd mysql
sudo useradd -r -g mysql mysql

4
sudo chown -R mysql:mysql /home/*****/mysql/mysql-5.5.39-linux2.6-i686

5
cd /home/*****/mysql/mysql-5.5.39-linux2.6-i686
sudo scripts/mysql_install_db –user=mysql

error信息如下
root@ubuntu:/home/*****/mysql/mysql-5.5.39-linux2.6-i686# scripts/mysql_install_db --user=mysql
scripts/mysql_install_db: 1: scripts/mysql_install_db: ./bin/my_print_defaults: not found
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

root@ubuntu:/home/*****/mysql/mysql-5.5.39-linux2.6-i686#


请高手指教! 谢谢!
更多



论坛徽章:
3
懒羊羊
日期:2015-03-04 14:52:112015年新春福章
日期:2015-03-06 11:58:18蒙奇·D·路飞
日期:2017-09-21 11:23:37
2#
发表于 2014-10-25 10:36 | 只看该作者
加入选项 --ledir=/home/*****/mysql/mysql-5.5.39-linux2.6-i686/bin

使用道具 举报

回复
论坛徽章:
6
2014年新春福章
日期:2014-02-18 16:44:08马上有对象
日期:2014-02-18 16:44:08优秀写手
日期:2015-01-13 06:00:15优秀写手
日期:2015-02-12 06:00:142015年新春福章
日期:2015-03-04 14:53:162015年新春福章
日期:2015-03-06 11:58:39
3#
 楼主| 发表于 2014-10-27 10:37 | 只看该作者
本帖最后由 starive 于 2014-10-27 10:39 编辑
lujinke 发表于 2014-10-25 10:36
加入选项 --ledir=/home/*****/mysql/mysql-5.5.39-linux2.6-i686/bin

谢谢你的回复! 不过,还是不行。出现的bug依然是原来的问题。问题如下:



******@ubuntu:/usr/local/mysql$ sudo scripts/mysql_install_db --user=mysql --ledir=/usr/local/mysql/bin
scripts/mysql_install_db: 1: scripts/mysql_install_db: ./bin/my_print_defaults: not found
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

使用道具 举报

回复
论坛徽章:
6
2014年新春福章
日期:2014-02-18 16:44:08马上有对象
日期:2014-02-18 16:44:08优秀写手
日期:2015-01-13 06:00:15优秀写手
日期:2015-02-12 06:00:142015年新春福章
日期:2015-03-04 14:53:162015年新春福章
日期:2015-03-06 11:58:39
4#
 楼主| 发表于 2014-10-27 11:20 | 只看该作者
lujinke 发表于 2014-10-25 10:36
加入选项 --ledir=/home/*****/mysql/mysql-5.5.39-linux2.6-i686/bin

按照 2 楼 的提示,我加入了参数“ -- force” 之后,又出现了如下错误:

*****@ubuntu:/usr/local/mysql$ sudo scripts/mysql_install_db --user=mysql --ledir=/usr/local/mysql/bin --force
scripts/mysql_install_db: 1: scripts/mysql_install_db: ./bin/my_print_defaults: not found
Installing MySQL system tables...
scripts/mysql_install_db: 403: scripts/mysql_install_db: ./bin/mysqld: not found


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.


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 submitting a bug report
at http://bugs.mysql.com/





到底问题在哪里,谁能帮忙解答下?

使用道具 举报

回复
论坛徽章:
3
懒羊羊
日期:2015-03-04 14:52:112015年新春福章
日期:2015-03-06 11:58:18蒙奇·D·路飞
日期:2017-09-21 11:23:37
5#
发表于 2014-10-27 17:44 | 只看该作者
starive 发表于 2014-10-27 11:20
按照 2 楼 的提示,我加入了参数“ -- force” 之后,又出现了如下错误:

*****@ubuntu:/usr/local/my ...

提示是说bin目录下的那些可执行文件找不到,你可以把mysql/bin这个目录加入环境变量PATH中

使用道具 举报

回复
论坛徽章:
6
2014年新春福章
日期:2014-02-18 16:44:08马上有对象
日期:2014-02-18 16:44:08优秀写手
日期:2015-01-13 06:00:15优秀写手
日期:2015-02-12 06:00:142015年新春福章
日期:2015-03-04 14:53:162015年新春福章
日期:2015-03-06 11:58:39
6#
 楼主| 发表于 2014-10-28 11:00 | 只看该作者
本帖最后由 starive 于 2014-10-28 13:26 编辑
lujinke 发表于 2014-10-27 17:44
提示是说bin目录下的那些可执行文件找不到,你可以把mysql/bin这个目录加入环境变量PATH中

谢谢你的回复!


加入如下环境变量:
在/etc/profile中添加:
export PATH=$PATH:/usr/local/mysql
export PATH=$PATH:/usr/local/mysql/data


export PATH=$PATH:/usr/local/mysql/bin

系统重启后,还是出现同样的错误:
scripts/mysql_install_db: 1: scripts/mysql_install_db: ./bin/my_print_defaults: not found
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



不知道是为什么,到底原因在哪里啊?

使用道具 举报

回复
论坛徽章:
3
懒羊羊
日期:2015-03-04 14:52:112015年新春福章
日期:2015-03-06 11:58:18蒙奇·D·路飞
日期:2017-09-21 11:23:37
7#
发表于 2014-10-28 12:04 | 只看该作者
本帖最后由 lujinke 于 2014-10-28 12:05 编辑
starive 发表于 2014-10-28 11:00
谢谢你的回复!

编辑该文件后不是立马生效,你可以echo $PATH看看它的值
可以编辑~/.bashrc
在里面加入上面的内容
然后source ~/.bashrc 一下就会生效了
PS:没必要使用sudo来运行该脚本吧

使用道具 举报

回复
论坛徽章:
6
2014年新春福章
日期:2014-02-18 16:44:08马上有对象
日期:2014-02-18 16:44:08优秀写手
日期:2015-01-13 06:00:15优秀写手
日期:2015-02-12 06:00:142015年新春福章
日期:2015-03-04 14:53:162015年新春福章
日期:2015-03-06 11:58:39
8#
 楼主| 发表于 2014-10-28 13:36 | 只看该作者
lujinke 发表于 2014-10-28 12:04
编辑该文件后不是立马生效,你可以echo $PATH看看它的值
可以编辑~/.bashrc
在里面加入上面的内容

我已经写入到 全局环境变量设置文件了:/etc/profile,并且马上重启操作系统了。

就完全没有必要再次写入到 ~/.bashrc

使用道具 举报

回复
论坛徽章:
6
2014年新春福章
日期:2014-02-18 16:44:08马上有对象
日期:2014-02-18 16:44:08优秀写手
日期:2015-01-13 06:00:15优秀写手
日期:2015-02-12 06:00:142015年新春福章
日期:2015-03-04 14:53:162015年新春福章
日期:2015-03-06 11:58:39
9#
 楼主| 发表于 2014-11-4 13:31 | 只看该作者
lujinke 发表于 2014-10-28 12:04
编辑该文件后不是立马生效,你可以echo $PATH看看它的值
可以编辑~/.bashrc
在里面加入上面的内容

修改了,还是没有解决问题。网友说需要修改 /etc/hosts文件。但是我的 hosts文件里面什么都有了。


##### /etc/hosts 文件内容如下:


root@ubuntu:/usr/local/mysql# more /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




使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表