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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- FATAL ERROR: Could not find ./bin/my_print_defaults 解決方法Error
- MySQL 5.6初始化資料庫時報錯FATAL ERROR: Could not find ./bin/my_print_defaultsMySql資料庫Error
- /bin/sh: 1: pahole: not found
- 【MySQL】mysql啟動報錯./mysqld_safe: my_print_defaults: not foundMySql
- MySQL error log和bin logMySqlError
- Error 15: File not found for RedhatErrorRedhat
- composer安裝完成輸入命令報錯:Fatal error: Class ‘Phar‘ not found in C:\\ProgramData\\ComposerSetup\\bin\\compoError
- Sub-process /usr/bin/dpkg returned an error codeError
- ERROR in Entry module not found Error Can't resolve 'babel' in ' UseErrorBabel
- ERROR: No abbreviations files found in ...nonbreaking_prefixesError
- /system/bin/sh: screenrecord: inaccessible or not found 報錯解決方案
- 關於java.lang.Error: Probable fatal error:No fonts found問題JavaError
- innobackupex:Error:xtrabackup child process has died at /usr/bin/innobackupexError
- /usr/bin/xauth: error in locking authority file錯誤Error
- MySQL 5.5初始化資料庫報錯FATAL ERROR: Could not find my_print_defaultsMySql資料庫Error
- [PM2][ERROR] Process XXX not foundError
- WSL:Sub-process /usr/bin/dpkg returned an error code (1)Error
- an error has occurred. - no valid devices were found...Errordev
- GPG key retrieval failed: [Errno 14] HTTP Error 404: Not FoundAIHTTPError
- Error: CreateProcess failed, Command: ‘C:\Keil_v5\ARM\ARMCC\bin\fromelf.exe --bin -o ..\OBJ\outputErrorAIOBJ
- Error:(4, 0) Plugin with id 'com.jakewharton.butterknife' not found.ErrorPlugin
- Error: Could not load module '/usr/local/nagios/bin/ndo2ErroriOS
- MysqL錯誤之_ERROR! MySQL server PID file could not be found!MySqlErrorServer
- Common Causes and Solutions on ORA-376 Error Found in Backup & RecoveryError
- MySQL 5.6複製報錯Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND;MySqlError
- ubuntu進行make時報錯error: Neither flex nor lex was found.UbuntuErrorFlex
- 釋出android apk,Error running app: No target device found.AndroidAPKErrorAPPdev
- 【MySQL】5.6.x InnoDB Error Table mysql.innodb_table_stats not foundMySqlError
- 急!!Error Parsing EJB file: Finder found in DD with no matching method.Error
- VMware虛擬機器重啟網路報錯" Error: No suitable device found"虛擬機ErrorUIdev
- configure: error: no acceptable C compiler found in $PATH 問題解決ErrorCompile
- 記處理線上記錄垃圾日誌 The view 'Error' or its master was not foundViewErrorAST
- 安裝 ESXi 出現錯誤 ERROR 1962: No operating system foundError
- PHP 5.4 編譯 configure: error: libXpm.(a|so) not found.PHP編譯Error
- Error:A problem was found with the configuration of task ':app:packageDebug' 問題解決ErrorAPPPackage
- mysql-python安裝時Environment Error: mysql_config not foundMySqlPythonError
- Causes and Solutions on ORA-1113 Error Found in Backup & Recovery_183367.1Error
- $FND_TOP/bin/txkrun.pl -script=DeployForms-c4ws Fails with Fatal ErrorORMAIError