Error ./bin/my_print_defaults: not found
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
安裝MySQL
本人在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#
安裝cluster
本人下載了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
安裝MySQL和Cluster出現的問題一模一樣
其實,這個問題在這臺機器(後面簡稱主機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上面都沒有人能解答???
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26435490/viewspace-1320844/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- /bin/sh: 1: pahole: not found
- composer安裝完成輸入命令報錯:Fatal error: Class ‘Phar‘ not found in C:\\ProgramData\\ComposerSetup\\bin\\compoError
- MySQL error log和bin logMySqlError
- ERROR: No abbreviations files found in ...nonbreaking_prefixesError
- [PM2][ERROR] Process XXX not foundError
- /system/bin/sh: screenrecord: inaccessible or not found 報錯解決方案
- Sub-process /usr/bin/dpkg returned an error codeError
- ERROR: freetype2 not found using pkg-configError
- WSL:Sub-process /usr/bin/dpkg returned an error code (1)Error
- Error: CreateProcess failed, Command: ‘C:\Keil_v5\ARM\ARMCC\bin\fromelf.exe --bin -o ..\OBJ\outputErrorAIOBJ
- Error executing Jupyter command 'notebok': [Errno 'jupyter-notebok' not found] 2Error
- PHP 5.4 編譯 configure: error: libXpm.(a|so) not found.PHP編譯Error
- MySQL 5.6複製報錯Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND;MySqlError
- mysql-python安裝時Environment Error: mysql_config not foundMySqlPythonError
- crsd.bin Fail With Error CRS-1019 When ohasd Restarted (文件 ID 2291799.1)AIErrorREST
- ubuntu進行make時報錯error: Neither flex nor lex was found.UbuntuErrorFlex
- Failed: error reading separator after document # 1: bad JSON array format - found no opening brackAIErrorJSONORM
- MySQL [ERROR] Slave I/O: Found a Gtid_log_event or Previous_gtids_log_eventMySqlError
- 記一次android app啟動錯誤 Error running :Default Activity not foundAndroidAPPError
- [Vue warn]: Error in render: "TypeError: Cannot read property 'matched' of undefined" found in <App> at src/App.vueVueErrorUndefinedAPP
- 編譯ffmpeg遇到ERROR: x265 not found using pkg-config解決方法編譯Error
- Flutter在iOS裝置執行報錯fatal error: 'Flutter/Flutter.h' file not foundFlutteriOSError
- CentOS載入yum源時報錯 [Errno 14] HTTP Error 404 - Not Found Trying other mirror.CentOSHTTPError
- /usr/bin/python與/usr/bin/env python的區別Python
- Could not find or access '/etc/ansible/bin/cfssljson /etc/ansible/bin/cfsslJSON
- VM+ubuntu,編譯huawei EC6109 SDK 報錯"[u-boot.bin] Error 1" ,未找到原因Ubuntu編譯bootError
- Win10系統edge打不開網頁提示“error 404--not found”如何解決Win10網頁Error
- shell指令碼頭,#!/bin/sh與#!/bin/bash的區別.指令碼
- 修改 Linux 預設 Shell 用 chsh -s /bin/zsh 命令不生效,提示 chsh: Shell not changed. 或 chsh: command not found 怎麼辦Linux
- -bash: id: command not found -bash: tty: command not found
- 7.30 BIN_TO_NUM
- python中#!/usr/bin/python與#!/usr/bin/env python的區別Python
- kubeadm not found
- Android Studio專案匯入之後出錯:Error:(1, 0) Plugin with id 'com.android.application' not found.AndroidErrorPluginAPP
- bin是什麼檔案格式 bin檔案要怎麼開啟
- nodemon: command not found
- pip: command not found
- found an invalid color
- 指令碼前面的/bin/bash指令碼