FATAL ERROR: Could not find ./bin/my_print_defaultsの解決策


mysqlデータベースの初期化中に、次のエラーメッセージが表示されます.
[root@localhost 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.

エラーメッセージに従ってmysqlインストールディレクトリのbinの下に行って_があるかどうかを検索します.print_defaults、最初の列の7行目にこのファイルが見つかりました
[root@localhost bin]# ls
innochecksum       mysql_client_test           mysql_setpermission
msql2mysql         mysql_client_test_embedded  mysqlshow
myisamchk          mysql_config                mysqlslap
myisam_ftdump      mysql_convert_table_format  mysqltest
myisamlog          mysqld                      mysqltest_embedded
myisampack         mysqld_multi                mysql_tzinfo_to_sql
my_print_defaults  mysqld_safe                 mysql_upgrade
mysql              mysqldump                   mysql_waitpid
mysqlaccess        mysqldumpslow               mysql_zap
mysqlaccess.conf   mysql_find_rows             perror
mysqladmin         mysql_fix_extensions        replace
mysqlbinlog        mysqlhotcopy                resolveip
mysqlbug           mysqlimport                 resolve_stack_dump
mysqlcheck         mysql_secure_installation

実はこの書類がないのではなく、この問題ではないようです.
エラーメッセージをよく見ると、そのパスは相対パスであり、mysqlのインストールディレクトリから始まることに気づきます.
初期化は、初期化スクリプトディレクトリに入ってスクリプトを実行しますが、このディレクトリの下にはありません./bin/my_print_defaultsの.
したがって、インストールディレクトリに戻って、初期化スクリプトを相対パスで実行します.
[root@localhost mysql]# ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
./bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl
Please report any problems with the ./bin/mysqlbug script!
[root@localhost mysql]#

OK!初期化成功!
皆さんに役に立つことを願っています.