DevHeads.net

How to start and stop mysql?

I need to start and stop mysql, and I've only figured out how to stop it.
I need to start it (not rebooting) so that I can temporarily use different
options. In my case, I need --skip-grant-tables.

Comments

Re: How to start and stop mysql?

By Wade Smart at 01/12/2018 - 10:08

sudo service mysql start

Re: How to start and stop mysql?

By Volker Wysk at 01/12/2018 - 10:22

Am Freitag, 12. Januar 2018, 09:08:22 CET schrieb Wade Smart:
This just starts mysql the normal way. But the OP said, that he needs to start it temporarily with self specified options.

The following is how mysql is normally started (this is taken from /etc/init.d/mysql):

# Start MySQL!
su - mysql -s /bin/sh -c "/usr/bin/mysqld_safe > /dev/null 2>&1 &"

So the OP could use this, modify it as needed.

Cheers
Volker