macOS에서의 my.cnf 파일 위치
이 튜토리얼에 따라 MySQL에 대한 원격 액세스를 활성화하려고 합니다.문제는, 어디에서my.cnf
X을 사용하고 Mac OS X Lion 。
기본적으로 OS X 설치에서는 my.cnf가 사용되지 않으며 MySQL에서는 기본값만 사용됩니다.my.cnf를 셋업하려면 /etc에서 파일을 직접 생성하기만 하면 됩니다.
X 에서는, OS X 의 설정 ./usr/local/mysql/support-files/
.
찾을 수 없는 경우 MySQLWorkbench에서 다음 방법으로 생성할 수 있습니다.
- 연결 열기
- 메뉴의 'INSTANCE'에서 'Options File'을 선택합니다.
- MySQLWorkbench는 my.cnf를 검색하여 찾을 수 없는 경우 my.cnf를 생성합니다.
X 할 때 Mac OS X Maverick에 /usr/local/opt/mysql/my.cnf
일반적으로 Unix 및 Unix와 유사한 시스템에서 MySQL/MariaDB 프로그램은 다음 위치에서 구성/시작 파일을 읽습니다(지정된 순서대로).
/etc/my.cnf
- 로로)/etc/mysql/my.cnf
- 로로)SYSCONFDIR/my.cnf
- 로로)SYSCONFDIR
는, 「」로 되어 있는 를 나타냅니다.SYSCONFDIR
" " " option to " " option to " )CMake
MySQL my축되 。아래에 입니다.기본적으로는 컴파일된 설치 디렉토리 아래에 있는 etc 디렉토리입니다.$MYSQL_HOME/my.cnf
고유 - 서버 고유(서버만)MYSQL_HOME
는, 서버 의 「」입니다.my.cnf
파일이 존재합니다. ifMYSQL_HOME
, 「」, 「」를 합니다.mysqld_safe
「 」를 참조해 주세요.mysqld_safe
을 로로로BASEDIR
Base MySQL Base 설치 디렉토리.「」로
--defaults-extra-file=path
있다 해도~/.my.cnf
사용자 - 사용자 고유 - 사용자 고유~/.mylogin.cnf
고유 - 사용자 고유(클라이언트만)
주의: Unix 플랫폼에서는 MySQL은 세계적으로 쓰기 가능한 구성 파일을 무시합니다.이것은, 시큐러티 대책으로서 의도적인 것입니다.
또한 Mac에서는 이를 확인하는 간단한 방법이 있습니다.
행::
sudo fs_usage | grep my.cnf
그러면 해당 파일과 관련된 파일 시스템 작업이 실시간으로 보고됩니다.
다른 터미널에서 MySQL/MariaDB를 재시작합니다.
brew services restart mysql
또는 다음과 같이 입력합니다.
brew services restart mariadb
에 「」가 붙어 있다.
fs_usage
적절한 위치를 표시해야 합니다.15:52:22 access /usr/local/Cellar/mariadb/10.1.14/my.cnf 0.000002 sh
파일이 존재하지 않으면 파일을 만듭니다.
어떤 버전의 MySQL을 사용하고 있는지 모르지만, Mac OS X에서 버전 5.5(여기서 가져온)용 my.cnf 파일의 위치는 다음과 같습니다.
/etc/my.cnf
/etc/mysql/my.cnf
SYSCONFDIR/my.cnf
$MYSQL_HOME/my.cnf
defaults-extra-file
( ( )로)--defaults-extra-file=path
(존재하는 경우)~/.my.cnf
macOS Sierra를 사용 중인데 파일이 존재하지 않는 경우,
mysql --help or mysql --help | grep my.cnf
my.cnf for mysql의 가능한 위치와 로드/읽기 시퀀스를 확인하려면 권장 디렉토리 중 하나에 my.cnf 파일을 작성한 후 다음 행을 추가합니다.
[mysqld] sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
하면 돼요.sudo touch /{preferred-path}/my.cnf
합니다.
sudo nano /{preferred-path}/my.cnf
그런 다음 MySQL을 재시작합니다.
Mac OS X El Capitan MySQL 5.7:/usr/local/mysql/etc/my.cnf
을 카피합니다./usr/local/mysql/support-files/my-default.cnf
MacOS MacOS Catalina(10.15.3)를 .my.cnf
/usr/local/etc
.
현재 Mac OS X Mavericks용 MySQL 패키지(이 문서 작성 시 mysql-5.6.17-osx10.7-x86_64)는 설치 중에 my.cnf를 자동으로 생성합니다.
다음 위치에 있습니다./usr/local/mysql-5.6.17-osx10.7-x86_64/my.cnf
버전에 따라 경로를 조정합니다.
macOS sierra 10.12.6
5.18_1MySQL © 5.7.18_1
locate my.cnf를 실행하면 경로가
/usr/local/etc/my.cnf
그래서 이 모든 것들이 나한테는 통하지 않았어.현재 mysql 커뮤니티 서버의 dmg 설치를 사용하고 있습니다.ps는 my.cnf의 모든 중요한 파라미터가 명령줄로 전달되는 것을 나타내고 있습니다.이 파라미터의 출처는 알 수 없었습니다.상자에 대한 전체 텍스트를 검색한 결과 다음과 같이 검색되었습니다.
/Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
my.cnf에 있는 것을 실제로 어디에 두는지 알 수 있도록 변경할 수도 있고 꺼낼 수도 있습니다.
맛있게 드세요!
해당 파일에 있는 파일 정보의 예:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key> <string>com.oracle.oss.mysql.mysqld</string>
<key>ProcessType</key> <string>Interactive</string>
<key>Disabled</key> <false/>
<key>RunAtLoad</key> <true/>
<key>KeepAlive</key> <true/>
<key>SessionCreate</key> <true/>
<key>LaunchOnlyOnce</key> <false/>
<key>UserName</key> <string>_mysql</string>
<key>GroupName</key> <string>_mysql</string>
<key>ExitTimeOut</key> <integer>600</integer>
<key>Program</key> <string>/usr/local/mysql/bin/mysqld</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mysql/bin/mysqld</string>
<string>--user=_mysql</string>
<string>--basedir=/usr/local/mysql</string>
<string>--datadir=/usr/local/mysql/data</string>
<string>--plugin-dir=/usr/local/mysql/lib/plugin</string>
<string>--log-error=/usr/local/mysql/data/mysqld.local.err</string>
<string>--pid-file=/usr/local/mysql/data/mysqld.local.pid</string>
<string>--keyring-file-data=/usr/local/mysql/keyring/keyring</string>
<string>--early-plugin-load=keyring_file=keyring_file.so</string>
</array>
<key>WorkingDirectory</key> <string>/usr/local/mysql</string>
</dict>
</plist>
원하는 디렉토리 아래에 파일을 생성할 수 있습니다.작성 후 mysql config 경로를 "알려" 줄 수 있습니다.
"이렇게 하다" 라고 입력하면 .locate my.cnf
Homebrew에서 설치한 mysql 5.6.22에서 my.cnf의 경로는
/usr/local/opt/mysql/my.cnf
터미널을 열고 다음 명령을 사용합니다.
sudo find / -name my.cnf
파일을 확인할 수 있습니다.
/usr/local/bin/mysql.server
부터를 참조해 주세요.my.conf
읽혀지고 있습니다.
★★★★★★★★★★★★★★★★★★★★★★★★★./etc/my.cnf
★★★★★★★★★★★★★★★★★」~/my.cnf
★★★★★★★★★★★★★★★★★」~/.my.cnf
문서를 읽어보세요!
MySQL Documents 。 상, 음, 음, 음, 음, 음, 음, 음, 음, 음, it, it, it, it, it, it 으로 표현합니다.Options File
★★★★★★★★★★★★★★★★★」MySQL Config File
.
가 기재되어 그 외의 파일도 기재되어 .VITAL
장소나 설정 파일의 표시 예를 나타냅니다.
중요사항:
Unix 플랫폼에서는 MySQL은 전역 쓰기 가능한 구성 파일을 무시합니다.
이것은, 시큐러티 대책으로서 의도적인 것입니다.
즉, 컨피규레이션파일에 잘못된 권한이 설정되어 있는 경우,는 로드되지 않습니다.
설정 파일 중 하나의 초기 셋업 권한의 예:
RIZZOMBP$ ls -lah /etc/my.cnf
-rw-r--r-- 1 myusername wheel 0B Feb 25 20:40 /etc/my.cnf
주의:
합니다.
!include
및 "다른 옵션파일"을하도록 지시합니다.!includedir
특정 디렉토리에서 옵션파일을 검색하려면 , ......MySQL은 디렉토리의 옵션 파일을 읽는 순서에 대해 보장하지 않습니다...
및 은 UNIX !includedir로 합니다.
.cnf
에서는, 이 의 파일을.ini
★★★★★★★★★★★★★★★★★」.cnf
내선 번호
설정 파일 또는 로그 파일의 위치를 검색하는 방법의 예:
SQL
설정 파일은 표시되지 않지만 설치 파일/폴더를 찾는 데 도움이 됩니다.
MySQL 버전 5.7 및 8 이상
SELECT * FROM PERFORMANCE_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_VALUE LIKE '%\/%';
MySQL 버전 <= 5.6
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_VALUE LIKE '%\/%';
셸/단말
RIZZOMBP$ mysql --help | grep "Default options" -A 1
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
위의 명령어 크레딧 To: ServerFault로부터의 Erwin Mayer
RIZZOMBP$ mysqld --verbose --help | grep '/my.cnf' -B 1
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
또는
RIZZOMBP$ ps aux | grep -i mysqld | grep -v $USER
_mysql 106 0.4 2.5 4232336 422112 ?? Ss 7:01PM 0:57.12
/usr/local/mysql/bin/mysqld
--user=_mysql
--basedir=/usr/local/mysql
--datadir=/usr/local/mysql/data
--plugin-dir=/usr/local/mysql/lib/plugin
--log-error=/usr/local/mysql/data/mysqld.local.err
--pid-file=/usr/local/mysql/data/mysqld.local.pid
--keyring-file-data=/usr/local/mysql/keyring/keyring
--early-plugin-load=keyring_file=keyring_file.so
샘플 파일
자세한 레퍼런스 샘플 my.cnf가 필요한 경우:
- https://gist.github.com/search?utf8=%E2%9C%93&q=my.cnf+mysql&ref=searchresults
- https://www.linode.com/community/questions/5749/mysql-sample-config-files
- https://www.fromdual.com/mysql-configuration-file-sample
URL과의 관련성/관련성이 없습니다.
내 시스템:
RIZZOMBP$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.3
BuildVersion: 18D109
RIZZOMBP$ mysql -V
mysql Ver 8.0.15 for macos10.14 on x86_64 (MySQL Community Server - GPL)
RIZZOMBP$ mysqld -V
/usr/local/mysql-8.0.15-macos10.14-x86_64/bin/mysqld
Ver 8.0.15 for macos10.14 on x86_64 (MySQL Community Server - GPL)
MacOS Montrey 12.0.1이 설치된 Mac M1에 Homebrew가 포함된 MySQL을 설치하는 경우 위치는 /opt/homebrew/etc/my.cnf입니다.
MAMP 3.5 Mac El Capitan의 경우 별도의 빈 설정 파일을 만들고 mysql에 대한 추가 설정을 작성합니다.
sudo vim /Applications/MAMP/Library/my.cnf
그리고 이렇게 추가합니다.
[mysqld]
max_allowed_packet = 256M
macOS High Sierra 버전 10.13.6
mysql Ver 14.14 EditLine 래퍼 Copyright (c) 2000, 2018, Oracle 및/또는 그 계열사를 사용하는 osx10.13(x86_64)용 배포 5.7.22.무단 전재 금지
기본 옵션은 다음 파일에서 지정된 순서대로 읽습니다.
/etc/my.cnf
/etc/mysql/my.cnf
/usr/local/etc/my.cnf
~/.my.cnf
/private/etc/my.cnf(Catalina용)
나는 MacOS 시에라리에게 확인되었다.MySql 5.7.12
지원 파일은 다음 위치에 있습니다.
/usr/local/opt/mysql/support-files
Just copy 복사만 하다my-default.cnf
as ~하듯이/etc/my.cnf
★★★★★★★★★★★★★★★★★」/etc/mysql/my.cnf
구성을 다시 시작할 것입니다.재기동시에 설정이 선택됩니다.
보통 이하여야 한다/usr/local/etc
수 없는 mac을 할 수 .
macOS High Sierra 버전 10.13.3에서 mysql 버전 5.7.17을 사용하고 있는데, 여기서 mysql 설정 파일을 찾았습니다.
cd /usr/local/mysql/support-files/my-default.cnf
mysql 8.0.19의 경우 my.cnf를 여기서 찾았습니다./usr/local/opt/mysql/.bottle/etc를 /usr/local/opt/mysql/에 복사하여 수정했습니다.그런 다음 mysql 서비스를 재시작하면 작동합니다.
Mac의 경우 ~ 경로에 .my.cnf 파일을 만드는 것이 효과가 있었습니다.이게 도움이 됐으면 좋겠다.
/usr/local/opt/mysql/support-files/my-default.cnf를 /etc/mysql/my.cnf로 복사한 후 mysql을 재시작합니다.
시에라 버전에서는
디폴트 설정을 카피합니다.
/usr/local/Cellar/mysql/5.6.27/support-files/my-default.cnf
로.
/usr/local/Cellar/mysql/5.6.27/my.cnf
제 경우에는 파일이 존재하지 않았습니다.MySQL Workbench에서 OPTIONS FILE로 이동하여 기본값을 찾았습니다.[적용]을 클릭합니다.허락을 구했어요.그런 다음 /etc 아래에 my.cnf 파일을 만듭니다.단, 처음 [적용(Apply)]를 클릭해도 기본설정은 변경되지 않습니다.파일이 생성되면 "적용"을 클릭하면 적용되는 내용을 변경할 수 있습니다.그렇지 않으면 변경할 때 적용 버튼이 표시되지 않습니다.
5.7.18 버전의 MySQL 이후에는 support-files 디렉토리에 기본 구성 파일이 제공되지 않습니다.따라서 /etc/mysql/my.cnf와 같이 MySQL이 읽히는 위치에 my.cnf 파일을 수동으로 생성하여 파일에 추가할 구성을 추가할 수 있습니다.
rDefault 옵션은 /etc/my.cnf /etc/mysql/my.cnf /usr / local / mysql / etc / my . cnf ~ / my . cnf 。
언급URL : https://stackoverflow.com/questions/10757169/location-of-my-cnf-file-on-macos
'programing' 카테고리의 다른 글
데이터베이스에 Enum을 저장하는 방법 (0) | 2022.12.07 |
---|---|
Java SE API만 사용하는 Java의 단순한 HTTP 서버 (0) | 2022.12.07 |
Google이 JSON 응답 앞에 (1)을 추가하는 이유는 무엇입니까? (0) | 2022.12.07 |
PHP에서 구성 파일 만들기 (0) | 2022.12.07 |
MySQL 루트 암호 제거 방법 (0) | 2022.12.07 |