Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Justin Rose
Justin Rose
12,809 Points

Mysql Workbench: PID file not found, cannot stop server

Hello Mysql Masters,

trying to figure out why i can't stop my server in Mysql

i tried this in the terminal sudo /usr/local/mysql/support-files/mysql.server stop

still i get the message PID file not found and SSL not enabled im lost. any help would be appreciated


3 Answers

Albert González
Albert González
22,953 Points

Try: "sudo service mysqld stop" and then "sudo service mysqld start"

Justin Rose
Justin Rose
12,809 Points

Nothing yet, ive tried multiple ways, I go to system preferences to Mysql and pull it up that way too and when i click stop server, it prompts for my password, I enter it and then it just flashes and doesn't turn off. Idk

So the PID file is literally just a text file containing the Process ID of the running MySQL process. If you're on a Unix-like system (OS X or Linux), you can do something like this:

myprompt$ ps aux | grep mysql
mysql     2888  0.2  4.0 1747972 324024 ?      Sl   Mar04  12:24 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql...

ps aux is listing the running processes on your system, while the grep mysql bit filters to output to only lines containing mysql. You might see a few more lines than this, but look for/some/path/mysqlor/some/path/mysqld`. It should look something like my example. The PID is the second column.

Once you have the PID, you literally can just send a signal to shut it down:

myprompt$ kill -TERM <your-pid-goes-here>

That will send the TERM signal to MySQL which should get it shutting down.

I don't have much experience with MySQL on Windows, but this might help. You'll probably need to change the paths in their examples to point to your installation.

That said, if you have frequent problems stopping MySQL because of PID issues it's pretty likely there's some configuration issue.