OSX를 Yosemite 또는 El Capitan으로 업그레이드 할 때 MySQL이 시작되지 않음
MAMP가있는 MySQL이 OSX Yosemite 10.10에서 작동하지 않는다는 것과 같은 유사한 질문이 있다는 것을 알고 있습니다. 그러나 내 컴퓨터에 MAMP 나 XAMPP가 설치되어 있지 않습니다.
PrefPane에서 mySQL을 시작하려고하면 아무 일도 일어나지 않습니다.
명령 줄에서 mqSQL을 시작하려고 sudo /usr/local/mysql/support-files/mysql.server start
하면 다음을 얻습니다.
Starting MySQL . ERROR! The server quit without updating PID file
(/usr/local/mysql/data/adamg.local.pid).
모든 도움을 주시면 감사하겠습니다. 필요한 모든 파일 출력을 제공 할 수 있습니다.
터미널 열기 :
"경고, / usr / local / mysql / data가 'mysql'또는 '_mysql'의 소유가 아닙니다.
그렇다면 mysql 폴더로 이동하십시오. cd / usr / local / mysql
DO가 sudo는 대한 Chown -R _mysql 데이터를 /
그러면 / usr / local / mysql / data 및 모든 콘텐츠의 소유권이 '_mysql'사용자가 소유하도록 변경됩니다.
MySQL 시스템 환경 패널을 확인하면 자동으로 실행되고 있다고 표시되어야합니다. 다시 시작하지 않으면.
확인하는 또 다른 방법은
netstat -na | 그렙 3306
다음과 같이 표시되어야합니다.
tcp46 0 0 *.3306 *.* LISTEN
mysqld의 프로세스 소유자 및 프로세스 ID를 보려면 :
ps aux | grep mysql
간단히 말해서 시작 파일을 만들어야합니다. 따라서 터미널에서 :
sudo vi /Library/LaunchDaemons/com.mysql.mysql.plist
(vi에 익숙하지 않은 경우을 눌러 i텍스트 삽입을 시작하십시오)
다음은 파일의 내용이어야합니다.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true />
<key>Label</key>
<string>com.mysql.mysqld</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/mysql/bin/mysqld_safe</string>
<string>--user=mysql</string>
</array>
</dict>
</plist>
누른 esc다음: wq!enter
그런 다음 파일에 올바른 권한을 부여하고 시작시로드되도록 설정해야합니다.
sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist
sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist
그리고 그게 다입니다.
제 경우에는 약간의 권한 변경을 수행하여 수정했습니다.
sudo chown -R _mysql:_mysql /usr/local/var/mysql
sudo mysql.server start
다른 사람에게 도움이되기를 바랍니다.
참고 : Mert Mertin 의견에 따라 :
el capitan의 경우 sudo chown -R _mysql : _mysql / usr / local / var / mysql
http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-10-yosemite/ 의 지침에 따라 최신 mySQL 릴리스를 설치하여 해결되었습니다 .
편집
요세미티가 인기를 끌수록 더 많은 사람들이이 질문에 걸림돌이되고 있습니다. 위의 대답은 MySQL을 업그레이드하여 실행되도록해야합니다. 주석에서 @doc로 연결된 대답은 MySQL이 자동으로 시작되도록하는 것과 관련이 있습니다. 두 가지 문제가 있습니다.
명령 줄에서 다음 명령을 실행합니다 ...
sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist
그런 다음 사용하여 mysql 서버를 시작하십시오.
sudo /usr/local/mysql/support-files/mysql.server start
.pid는 실행중인 mysql 서버 인스턴스의 프로세스 ID입니다. mysql이 실행 중일 때 데이터 폴더에 나타나고 mysql이 종료되면 자동으로 제거됩니다.
If the OSX operating system is upgraded and mysql is not shutdown properly before the upgrade,mysql quits when it started up it just quits because of the .pid file.
There are a few tricks you can try, http://coolestguidesontheplanet.com/mysql-error-server-quit-without-updating-pid-file/ failing these a reinstall is needed.
You just need to create the user mysql
(mysql installation script creates _mysql)
sudo vipw
duplicate line that contains _mysql
Change for the duplicated line _mysql
to mysql
sudo /usr/local/mysql/support-files/mysql.server start
Starting MySQL
.. SUCCESS!
The re-install fixed it because the installer created a new MySQL instance and the symbolic link to /usr/local/mysql now points to a data directory that does not have an existing pid.
It's worth noting that the mysql prefpane and mysql.server script use the hostname for the pid, so changing the hostname may cause issues with the this.
While the prefpane is out of date, it's a nice GUI for someone to start/stop MySQL even if the auto-start function doesn't work.
I've taken a hybrid approach where I've adapted my MySQL install script to use Launchd to auto-start MySQL, but the plist actually calls the mysql.server script. This way the prefpane can still be used to start/stop MySQL on demand, and trying to do a simple MySQL restart won't be too confusing.
Here is script that just enables this Launchd behavior on Yosemite with MySQL already installed: https://raw.githubusercontent.com/MacMiniVault/Mac-Scripts/master/mmvMySQL/YosemiteLaunchd.sh
Here is the script that handles the entire automated installation of MySQL: https://raw.githubusercontent.com/MacMiniVault/Mac-Scripts/master/mmvMySQL/mmvmysql.sh
You will sometimes miss previous data if you try to install new version.. Please use the following in your terminal and I guarantee that mySql will start running in no time..
sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start
Remember, it will ask for your Machine password and not mysql password..
I’ve got a similar problem with MySQL on a Mac (Mac Os X Could not startup MySQL Server. Reason: 255 and also “ERROR! The server quit without updating PID file”). After a long trial and error process, finally in order to restore the file permissions, I’ve just do that:
* launch the Disk Utilities.app
* choose my drive on the left panel
* click on the “Repair disk permissions” button
This did the trick for me.
Hoping this can help someone else.
Try this:
sudo mysqld_safe &
Way simplest: copy and paste this into Terminal (but be sure to read more first):
bash <(curl -Ls http://git.io/eUx7rg)
This will install and configure everything automagically. The script is provided by MacMiniVault and is available on Github. More information about the mySQL install script on http://www.macminivault.com/mysql-yosemite/.
you want fix it can edit file "/Applications/XAMPP/xamppfiles/xampp" with TextEdit.
Look for text "$XAMPP_ROOT/bin/mysql.server start > /dev/null &"
And add "unset DYLD_LIBRARY_PATH" on top of it. It should look like:
unset DYLD_LIBRARY_PATH
$XAMPP_ROOT/bin/mysql.server start > /dev/null &
hope can help you
None of the above worked.. but installing a new version of MySQL did the trick.
2 steps solved my problem:
1) Delete "/Library/LaunchDaemons/com.mysql.mysql.plist"
2) Restart Yosemite
I usually start mysql server by typing
$ mysql.server start
without sudo. But in error I type sudo before the command. Now I have to remove the error file to start the server.
$ sudo rm /usr/local/var/mysql/`hostname`.err
My Mac decided to restart itself randomly; causing a whole slew of errors. One of which, was mysql refusing to start up properly. I went through many SO questions/answers as well as other sites.
Ultimately what ended up resolving MY issue was this:
1) Creating the file (/usr/local/mysql/data/.local.pid
2) chmod 777 on that file
3) executing mysql.server start (mine was located in/usr/local/bin/mysql.server)
Same happened to me! So I tried to startup again after I had terminated the running mysql application, and that worked!
'Development Tip' 카테고리의 다른 글
Android : getSupportActionBar ()는 ActionBarSherlock 라이브러리에서 항상 null을 반환합니다. (0) | 2020.11.12 |
---|---|
캔버스에 맞게 이미지 크기 조정 (0) | 2020.11.12 |
편리한 F # 스 니펫 (0) | 2020.11.12 |
이름 "XYZ"가 네임 스페이스 "clr-namespace : ABC"에 없습니다. (0) | 2020.11.12 |
녹색에서 빨간색으로 백분율에 따라 다름 (0) | 2020.11.12 |