ここからmysql-5.1.38-linux-x86_64-glibc23.tar.gzをダウンロードしました
そして、以下のコマンドを使用して実行しました
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/
次に、my.cnf を編集し、basedir と datadir を/home/mysql123/mysqlと/home/mysql123/mysql/dataに設定し、innodb_home_dir と logfile ディレクトリを datadir に設定しました。
mysql.serverを編集し、datadirとbasedirを適切に設定しました
次に、mysql_install_db を次のように開始しました。
[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
エラーを見て、私はそれがbasedirと混同されている可能性があると思い、以下と同じように実行しました
[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
私は内部で何が起こっているのかを理解しておらず、この種のメッセージを表示しています
そして、十分なディスク容量 ( df -h ) があり、適切な所有権 ( chown mysq123:mysql /home/mysql123/ -R ) と適切な権限 ( chmod 755 . )があると確信しています。
mysql_install_db の行は次のようになります
この問題を解決するための助けは非常に役に立ちます(そして、同じインストールプロセスに従う必要があります)
私はredhat 6を使用しています