program tip

Brew를 통해 MySQL을 설치 한 후 오류가 발생합니다.-PID 파일을 업데이트하지 않고 서버가 종료되었습니다.

radiobox 2020. 10. 20. 07:28
반응형

Brew를 통해 MySQL을 설치 한 후 오류가 발생합니다.-PID 파일을 업데이트하지 않고 서버가 종료되었습니다.


좋아, 나는 모든 것을 검색했고 설치, 제거, 다양한 옵션 시도에 상당한 시간을 보냈지 만 성공하지 못했습니다.

저는 Mac OS X Lion (10.7.3)을 사용 중이며 Python, MySQL을 설정하려고합니다.

HomeBrew를 통해 Python과 MySQL을 성공적으로 설치했습니다. Python은 훌륭하게 작동합니다.

MySQL 설치 후 처음 두 단계, 즉 unset 및 mysql_install_db명령을 수행했습니다.

이제 mysql "mysql.server start"를 시작하려고하면 다음과 같은 오류가 발생합니다.

ERROR! The server quit without updating PID file (/usr/local/var/mysql/Brajeshwar.local.pid).
  • Brajeshwar 내 컴퓨터의 사용자 이름입니다.

2012/09/18 편집 : Kane이 지적한 대로 mysql다른 작업을 수행하기 전에 데이터베이스가 제대로 설정 되었는지 확인하십시오 . mysql.server 시작시 PID 오류? " 더 많은 정보를 위해서.

기록을 위해 원래 답변 유지 : 권한 문제 일 가능성 큽니다 . 확인하십시오 /usr/local/var/mysql/*.err. 내 말 :

120314 16:30:14  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
120314 16:30:14 mysqld_safe mysqld from pid file /usr/local/var/mysql/janmoesen.local.pid ended

나는 또한 이것을해야했다 :

sudo chown _mysql /usr/local/var/mysql/*

mysql폴더 의 권한 문제라는 것을 발견했습니다 .

chmod -R 777 /usr/local/var/mysql/ 

나를 위해 해결했습니다.


결국 mysql을 완전히 다시 설치하고 마침내 해결되었습니다.

경고 이렇게하면 모든 데이터베이스가 제거되므로 먼저 덤프를 저장해야합니다.

brew remove mysql
brew cleanup
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /usr/local/var/mysql

brew install mysql
mysqld --initialize --explicit_defaults_for_timestamp
mysql.server start # no sudo!

Mac 10.10.5 Yosemite에서이 문제가 발생했습니다.

이 문제를 해결하기 위해 내가 한 일

cd /usr/local/var/mysql
sudo rm *.err && sudo rm *.pid
sudo reboot
sudo mysql.server start


2014 년 11 월 : Mac OS X Mavericks 또는 Yosemite의 MySQL 5.6.x에서이 오류가 발생하고 로컬에서 PHP와 함께 MySQL을 사용하려는 경우 (/tmp/mysql.sock에서 PHP PDO가 sock 파일을 찾을 것으로 예상 함), 나를 위해 수정 한 내용은 다음과 같습니다.

1) 기본 homebrew 구성 파일 행의 주석 처리를 제거하고 아래와 같이 편집하십시오.

$ sudo vi /usr/local/Cellar/mysql/5.6.21/my.cnf
...
basedir = /usr/local/Cellar/mysql/5.6.21
datadir = /usr/local/var/mysql
port = 3306
server_id = <UNIQUE_NUMBER_HERE_OR_LEAVE_COMMENTED_OUT>
socket = /tmp/mysql.sock
pid-file = /usr/local/var/mysql/[BOXNAME].local.pid
....

BOXNAME은 시스템 환경 설정-> 네트워크에서 네트워크상의 컴퓨터 고유 ID로 가지고있는 것입니다.

2) mysql datadir의 모든 파일에 대한 권한을 설정합니다. 이들은 모두 [my_username] 소유입니다. MySQL은 이것에 대해 매우 까다 롭고 (사용자 _mysql)이 디렉토리를 소유하지 않는 한 pid 파일 생성을 거부합니다.

$ sudo chown -R _mysql:mysql /usr/local/var/mysql

3) bash 도우미 / 래퍼 스크립트를 사용하여 MySQL을 시작합니다.

$ sudo mysql.server start
Starting MySQL
. SUCCESS! 

도움이되기를 바랍니다. 위의 방법이 작동하지 않으면 Cellar / mysql / VERSION_ / bin / 디렉토리에서 mysqld_safe 바이너리를 수동으로 실행하고 설정이 무엇인지 확인하십시오 (실행되는 경우).

sudo /usr/local/Cellar/mysql/5.6.12/bin/mysqld_safe &

실행되면 다음을 수행 할 수 있습니다.

ps aux | grep mysql 

그리고 같은 것을 본다

[username]  6881   0.0  2.7  3081392 454836   ??  S     8:52AM   0:00.54 /usr/local/Cellar/mysql/5.6.21/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.6.21 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/mysql/5.6.21/lib/plugin --verbose --log-error=/usr/local/var/mysql/BOXNAME.local.err --pid-file=/usr/local/var/mysql/BOXNAME.local.pid

왜 그것이 저에게 효과가 있었는지 잘 모르겠지만 my.cnf 구성 파일 옵션을 어디서 얻었는지 보여줍니다. 명령 줄 옵션을 사용하여 mysqld를 수동으로 시작할 때 문제를 해결할 수도 있습니다.

mysqld_safe를 사용하여 MySQL 서버를 실행하기 위해 manage를 실행하는 경우 mysql.server bash 도우미를 시도하기 전에이 작업을 수행하여 종료해야 할 수 있습니다. 데이터를 손상시킬 수 있으므로 -9 [PID]를 죽이려는 충동을 억제하십시오.

mysqladmin -uroot shutdown

행운을 빕니다!


OS X El Capitan에서 동일한 문제가 발생했습니다. 여기에 문제를 해결 한 터미널 명령 시퀀스가 ​​있습니다.

오류 파일 삭제 (설정에 따라 경로를 변경해야 함)

sudo rm /usr/local/mysql/data/*.err

아직 실행중인 mysql 프로세스에 대한 정보를 찾아서 종료합니다.

ps -A | grep -m1 mysql | awk '{print $1}' | sudo xargs kill -9

이제 MySQL을 다시 시작하십시오.

/usr/local/mysql/support-files/mysql.server start

이것은 나를 위해 일했습니다.

sudo chmod -R 777 /usr/local/var/mysql/
sudo /usr/local/mysql/support-files/mysql.server start

올바르게 기억하면 권한 문제입니다. pid 파일이나 파일이있는 폴더를 '터치'하고 'chmod'해보십시오.


내 문제는 한 번 sudo로 서버를 시작한 다음 로컬 사용자로 다시 시작하려고 시도했다는 것입니다.

여기서 mysql은 루트가 소유 한 '.err'파일에 쓸 수 없습니다. 해당 파일을 제거하고 서버를 다시 시작해야했습니다.

sudo rm /usr/local/var/mysql/*.err
mysql.server start

이것은 10.12.2에서 나를 위해 일했습니다.

$ rm /usr/local/var/mysql/*.err

그때

$ brew services restart mysql

Mac에서 MySQL과 비슷한 문제가 있습니다 (Mac Os X에서 MySQL 서버를 시작할 수 없습니다. 이유 : 255 및 "오류! PID 파일을 업데이트하지 않고 서버가 종료되었습니다"). : 긴 시행 착오 과정 후, 마지막으로 파일 권한을 복원하기 위해, 난 그냥 그렇게했습니다

출시 디스크 Utilities.app가
왼쪽 패널의 내 드라이브 선택
버튼은 "디스크 권한 복구"에 클릭

이 속임수를 썼는지 나를 위해. 이것이 다른 사람을 도울 수 있기를 바랍니다.


나를 위해 그것은 다음과 함께 일했습니다.

unset TMPDIR
mysql_install_db --user=`whoami` --basedir="$(brew --prefix mariadb)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

나를 위해 일한 것은 다음과 같습니다.

  1. mysql 설치 디렉토리로 이동하십시오.
  2. sudo chmod -R 777 data
  3. 그런 다음 한 디렉토리로 돌아가십시오.
  4. cd support-files/
  5. sudo ./mysql.server start

그 후 서버가 실행되기 시작했습니다.

그러나이 방법의 문제점은 지금 mysql을 시작할 때마다 이것을 반복해야한다는 것입니다. 왜 갑자기 이렇게 행동하기 시작했는지 모르겠습니다.


usr / local / var / mysql / your_computer_name.local.err 파일을 찾아 오류에 대한 자세한 정보를 이해하십시오.

위치 : /usr/local/var/mysql/your_computer_name.local.err

권한 문제 일 수 있습니다.

  1. mysql이 실행 중인지 확인하고 종료하십시오.

ps -ef | grep mysql

죽이기 -9 PID

여기서 PID는 두 번째 열 값입니다. 2. mysql 소유권 확인

ls -laF / usr / local / var / mysql /

if it is owned by root, change it mysql or your user name

sudo chown -R mysql / usr / local / var / mysql /


이것을 시도하십시오 (OSX)

1 단계: ps -aux | grep mysql

그런 다음 4 자리 PID 번호를 죽입니다.

2 단계: kill 1965

3 단계 : mysql.server start

또는 해당 PID 번호를 찾는 데 어려움이있는 경우 아래에서 시도해보십시오.

다시 1 단계 : ps -aux | grep mysql

다시 2 단계 : killall

다시 3 단계 : mysql.server start


sudo chmod -R 777 /usr/local/var/mysql/

나를 위해 작동합니다.


나는 같은 문제가 있었다.

하지만 상황은 내가 들어 가려고 할 때마다 :

/usr/local/mysql/support-files/mysql.server start

a file named localhost.pid is created instead of iMax0.local.pid which was stated in the error:

ERROR! The server quit without updating PID file (/usr/local/mysql/data/iMax0.local.pid).

Solution that works for me was copying localhost.pid and renaming it to iMax0.local.pid.


My solution on OSX El Capitan was:

sudo chmod ugo+w /tmp

It was broken suddenly.

The error was:

ERROR! The server quit without updating PID file

and the log showed:

Can't start server : Bind on unix socket: Permission denied

It might also be helpful to note, that under OSX there is no my.cnf file by default and not needed by default, which I did not know. Good luck!


$ sudo mysql.server restart

It works for me.


I had the similar issue. But the following commands saved me.

cd /usr/local/Cellar
sudo chown _mysql mysql

This is file permission problem. Check disk permissions and repair.

Osx => Cmd+Space => Disk Utilty => Verify Disk Permissions.

Verify completed after Repair Disk Permissions. mysql.server start command is worked succesfuly.


None of the answers worked for me. However, I simply did sudo mysql.server start and it worked nicely.

Also, for me, it did NOT show permissions issue in *.err file.


I had this problem on Linux, but the cause is relevant to any mysql installation. In my case, the server was crashing before startup was complete and the pid file updated. The error messages were seen when starting up mysqld directly instead of via "service mysql start".

In my case, the cause was the partition where the log files were located being full. Removing log files permitted mysql to start again. To test for this issue, go to the location of your mysql activity logs, and do df ..


If you have upgraded your mysql installation to 8.x, check if your previous version is supported for upgradation.

If not, mysql will not work! Uninstall your mysql along with all configuration files in /usr/local/var/mysql (remove the whole folder). Reinstall mysql.

NOTE: reinstalling might lead to loss of data.


all solutions above doesn't work for me. but they give me some clues to fix this error.

mysql.server start ----error The server quit without updating PID file

I installed mysql@5.7 on my macbook mojave with homebrew

brew install mysql@5.7

mysql error log located in /usr/local/var/mysql/IU.lan.err,there is one line in it: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist

after trying many posts in goole search engine,I turned to baidu https://blog.csdn.net/xhool/article/details/52398042 inspired by this post,I found the solution:

rm /usr/local/var/mysql/*

mysqld --initialize

a random password for root user will be shown in bash. but the command mysql -uroot -p[theRandomPassword] cant work.so I have to reset password. create a init file with contents like this

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');

place it in any directory easy to find,such as Desktop

mysqld --init-file=[YourInitFile] &

many logs printed on your screen.

mysql -uroot -pMyNewPass

enjoy your high-version mysql!


Please check the log , you will get more detailed information .

Use the below command to tail the error log

tail -100 /usr/local/var/mysql/<user_name>.local.err

For me , one of the directory is missing , once created the server has started .


While Installing from source,please follow the instruction in file INSTALL-SOURCE

where installation instruction are given in section 2.8

after installation ,check are there any process running of mysql with ps aux | grep mysql

You'll find like this

root      1817  0.0  0.0 108336  1228 ?        S    Jan21   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/mail.gaurav.local.pid
mysql     2141  0.0  1.2 497660 24588 ?        Sl   Jan21   0:26 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/mail.gaurav.local.err --pid-file=/usr/local/mysql/data/mail.gaurav.local.pid --socket=/tmp/mysql.sock --port=3306
root      5659  0.0  0.0 103256   840 pts/13   S+   11:30   0:00 grep mysql

kill all process related to mysql,and then try to start mysql server


First mv -f /var/lib/mysql /var/lib/mysql.bak and try the command mysql_install_db --user=mysql --ldata=[destination] replace the destination with the data directory, after that start the MySQL with /etc/init.d/mysql restart

참고URL : https://stackoverflow.com/questions/9624774/after-mysql-install-via-brew-i-get-the-error-the-server-quit-without-updating

반응형