MySQL pid ended (cannot start mysql)

丶灬走出姿态 提交于 2019-11-28 05:19:25

I have the same problem when installing mysql newest version mysql-5.6.10-osx10.7-x86.dmg for my MAC OS 10.7.5. Following is my solutions. First , delete the mysql installed

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*

Then, get mysql-5.1.68-osx10.6-x86.dmg , install this old version, and done!

since I cannot post comments (got <50 reputation :( ) I am writing it here :)

as @AndPy says, the same with me, if you ls -l the /usr/local/var/mysql you can see that the file COMPUTER-NAME.local.err is owned by _mysql or some such.... in this case just erase the file and mysql.server start will create new one owned by your user and will start properly this time :)

If the file is already owned by your user, this wont help, you got to google more :(

I found this error on redmine bitnami stack because owner of files in directory data incorrect.

Check owner of directory /mysql/data/ must be 'mysql' user

Hope this help.

Michael Zumstein

I had the same problem after updating to OS X Mavericks.

Starting MySQL . ERROR! The server quit without updating PID file

Like Redrick and AndPy mentioned I also had to rename (actually I deleted the file) the error file located in $ cd /usr/local/var/mysql. My error file was called localhost.err. After removing the file with $ rm localhost.err I could finally start MySQL again with $ mysql.server start.

I had the same problem.

In /usr/local/var/mysql I found a file in the form COMPUTER-NAME.local.err. Simply changing that file name solved the problem. I could now start the mysql server with

mysql.server start

My answer is very similar to others, but slightly different and this applies mostly to a bitnami mamp stack. The fix for me was:

sudo chown -R mysql mysql/

The mysql/ directory is the one located in Applications/<mampstack-version>/

The above sets the mysql to be the owner of the mysql directory recursively into the other directories.

If you want to absolutely get this thing working do the following:

You need to uninstall mysql first so do that, before you do this though, make sure you have a backup of all your DBs.

brew remove mysql

Then you need to make sure certain files are uninstalled, make a batch script of the following commands and run it:

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*

Go to /etc/hostconfig using your favorite editing program and remove the line MYSQLCOM=-YES-

Then run brew cleanup then install mysql using brew install mysql

After you've done this you'll probably get the same error again. Head over to the folder cd /usr/local/var/mysql/. There should be a file in there called localhost.local.err

run cat ./localhost.local.err and look in the file. You should see something similar to:

2018-03-24 15:41:49 140735679804288 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 48: Address already in use

2018-03-24 15:41:49 140735679804288 [ERROR] Do you already have another mysqld server running on port: 3306 ?

If you do, run the command sudo lsof -i :3306 and you'll probably get something back like this:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mysqld 74 _mysql 20u IPv6 0xXXXXXXXXXXXXX 0t0 TCP *:mysql (LISTEN)

This means mysql is already running and listening on port 3306 and you need to kill it. Use top to kill the program or just use Activity Monitor to kill it. Either way once that's done go back to cd /usr/local/var/mysql/ and delete the folder localhost.local.err.

Once that's done run mysql.server start and you should get the following:

180324 15:46:18 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql SUCCESS!

And congrats. I've been trying to fix this for a week and it's such an easy fix and I just figured it out. I hate myself.

120515 18:13:01 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

  • Regarding this error, I assume that you have specified a datadir in my.cnf. If you are using a non-default data directory for MySQL, you need to move folders mysql and performance_schema (whichever exists) to the data directory specified in my.cnf. You can find these folders in mysql directory.

In MySQL 5.5+ the --skip-locking option is removed. Use --skip-external-locking instead. Refer to MySQL documentation --> http://dev.mysql.com/doc/refman/5.5/en/mysql-nutshell.html Quote: "The --enable-locking and --skip-locking server options (use --external-locking and --skip-external-locking)."

Give this a whirl..

  1. Navigate to the problem's parent directory cd YOURPATH/usr/local/mysql
  2. rm -rf *.local.err (deletes file)
  3. touch YOURUSERNAME.local.pid (generates new *.local.pid file the error thrown was complaining about)
  4. cd back into your project and restart mysql using mysql.server start

Only removing mysql-bin.index file in /usr/local/var/mysql/ helped me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!