Learning Mysql


Search Order for Options Files



Download 4.24 Mb.
View original pdf
Page343/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   339   340   341   342   343   344   345   346   ...   366
Learning MySQL
Search Order for Options Files
The MySQL server and client programs look for options files in the standard locations and read them in order values from later files take precedence over earlier ones. Options specified on the command line override values from options files.
Search Order for Options Files | 375

You can tell a MySQL program to ignore the default options files by telling it to read a specific file at a location given with the defaults-file option. For example, you can write mysql --defaults-file=path_to_options_file
If you’d like to use an options file alongside the default files, you can specify it using the defaults-extra-file option mysql --defaults-extra-file=path_to_local_options_file
Finally, you can prevent programs from reading in any options files by adding the no- defaults option mysql --no-defaults
On a Linux or Mac OS X system, the search order is /etc/my.cnf, then
/my.cnf, defaults-extra-file
, and finally
/.my.cnf
. Note that for security reasons, files that are world-writable are ignored. A generally appropriate permission setting is for the file owner (user) to be able to read and write the file, but for the group and others to be able to only read the file. You can set this level of access by opening a terminal window and typing chmod u=rw,g=r,o=r configuration_file
Note that if you’re trying to change the permissions of a file owned by the system root user, you’ll need to run the chmod command when logged in as the system root user, or prefix the command with the sudo keyword.
On a Windows system, clients try to access options files in this order first
dows_Directory>\my.ini, then \my.cnf, C:\my.ini, C:\my.cnf,
\my.ini, \my.cnf and then defaults-extra- file. Again, under Windows, the server doesn’t read in the options file automatically,
and you need to tell it to do sousing the defaults-file option.

Download 4.24 Mb.

Share with your friends:
1   ...   339   340   341   342   343   344   345   346   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page