自作のMySQLのインストールの場合、my.cnfはどこにありますか? 質問する

自作のMySQLのインストールの場合、my.cnfはどこにありますか? 質問する

自作の MySQL インストールの場合、my.cnf はどこにありますか? インストールされますか?

ベストアンサー1

デフォルトでは my.cnf はありません。そのため、MySQL はすべてデフォルト設定で起動します。デフォルトを上書きする独自の my.cnf を作成する場合は、それを /etc/my.cnf に配置します。

また、mysql --helpこれを実行して、リストされている conf の場所を確認することもできます。

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf 
The following groups are read: mysql client
The following options may be given as the first argument:
--print-defaults        Print the program argument list and exit.
--no-defaults           Don't read default options from any option file.
--defaults-file=#       Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.

ご覧のとおり、conf ファイルをバイパスしたり、コマンドラインで mysql を呼び出すときに読み取る他のファイルを指定したりするためのオプションもいくつかあります。

おすすめ記事