我从这里下载了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 中的行如下所示
请帮助解决这个问题非常有用(我必须遵循相同的安装过程)
我正在使用红帽 6