How to start and stop mysql?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How to start and stop mysql?

Kevin O'Gorman
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.

--
Kevin O'Gorman
#define QUESTION ((bb) || (!bb))   /* Shakespeare */

Please consider the environment before printing this email.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start and stop mysql?

Wade Smart-2
On Fri, Jan 12, 2018 at 9:03 AM, Kevin O'Gorman <[hidden email]> wrote:
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.

--
Kevin O'Gorman
#define QUESTION ((bb) || (!bb))   /* Shakespeare */

Please consider the environment before printing this email.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



sudo service mysql start

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start and stop mysql?

Volker Wysk
Am Freitag, 12. Januar 2018, 09:08:22 CET schrieb Wade Smart:
> On Fri, Jan 12, 2018 at 9:03 AM, Kevin O'Gorman <[hidden email]> wrote:
>
> > 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.
 
> sudo service mysql start

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


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start and stop mysql?

Kevin O'Gorman


On Fri, Jan 12, 2018 at 7:22 AM, Volker Wysk <[hidden email]> wrote:
Am Freitag, 12. Januar 2018, 09:08:22 CET schrieb Wade Smart:
> On Fri, Jan 12, 2018 at 9:03 AM, Kevin O'Gorman <[hidden email]> wrote:
>
> > 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.

> sudo service mysql start

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


Thanks.  Useful, I hope, but SHEESH! that mysqld_safe is over 1,000 lines of code.  I'll figure out how to use and modify it somehow....


--
Kevin O'Gorman
#define QUESTION ((bb) || (!bb))   /* Shakespeare */

Please consider the environment before printing this email.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start and stop mysql?

Colin Law
On 12 January 2018 at 16:46, Kevin O'Gorman <[hidden email]> wrote:


On Fri, Jan 12, 2018 at 7:22 AM, Volker Wysk <[hidden email]> wrote:
Am Freitag, 12. Januar 2018, 09:08:22 CET schrieb Wade Smart:
> On Fri, Jan 12, 2018 at 9:03 AM, Kevin O'Gorman <[hidden email]> wrote:
>
> > 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.

> sudo service mysql start

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


Thanks.  Useful, I hope, but SHEESH! that mysqld_safe is over 1,000 lines of code.  I'll figure out how to use and modify it somehow....

I believe you should be able to pass the option to mysqld_safe and it will be passed to mysqld

Colin
 


--
Kevin O'Gorman
#define QUESTION ((bb) || (!bb))   /* Shakespeare */

Please consider the environment before printing this email.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start and stop mysql?

Volker Wysk
In reply to this post by Kevin O'Gorman
Am Freitag, 12. Januar 2018, 08:46:21 CET schrieb Kevin O'Gorman:

> On Fri, Jan 12, 2018 at 7:22 AM, Volker Wysk <[hidden email]> wrote:
>
> > Am Freitag, 12. Januar 2018, 09:08:22 CET schrieb Wade Smart:
> > > On Fri, Jan 12, 2018 at 9:03 AM, Kevin O'Gorman <[hidden email]>
> > wrote:
> > >
> > > > 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.
> >
> > > sudo service mysql start
> >
> > 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
> >
> >
> Thanks.  Useful, I hope, but SHEESH! that mysqld_safe is over 1,000 lines
> of code.  I'll figure out how to use and modify it somehow....

Good luck

Volker


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start and stop mysql?

Kevin O'Gorman


On Fri, Jan 12, 2018 at 9:09 AM, Volker Wysk <[hidden email]> wrote:
Am Freitag, 12. Januar 2018, 08:46:21 CET schrieb Kevin O'Gorman:
> On Fri, Jan 12, 2018 at 7:22 AM, Volker Wysk <[hidden email]> wrote:
>
> > Am Freitag, 12. Januar 2018, 09:08:22 CET schrieb Wade Smart:
> > > On Fri, Jan 12, 2018 at 9:03 AM, Kevin O'Gorman <[hidden email]>
> > wrote:
> > >
> > > > 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.
> >
> > > sudo service mysql start
> >
> > 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
> >
> >
> Thanks.  Useful, I hope, but SHEESH! that mysqld_safe is over 1,000 lines
> of code.  I'll figure out how to use and modify it somehow....

Good luck

Volker


Thanks, but even copying that command line does not work:
  su - mysql -s /bin/sh -c "/usr/bin/mysqld_safe > /dev/null  2>&1 &"
  No directory, logging in with HOME=/

And mysql itself reports
  ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 
But 'service mysql start' works okay.   I'll have to figure out how it does that.  Or just temporarily edit mysqld_safe.


--
Kevin O'Gorman
#define QUESTION ((bb) || (!bb))   /* Shakespeare */

Please consider the environment before printing this email.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start and stop mysql?

Kevin O'Gorman
On Fri, Jan 12, 2018 at 10:27 AM, Kevin O'Gorman <[hidden email]> wrote:


On Fri, Jan 12, 2018 at 9:09 AM, Volker Wysk <[hidden email]> wrote:
Am Freitag, 12. Januar 2018, 08:46:21 CET schrieb Kevin O'Gorman:
> On Fri, Jan 12, 2018 at 7:22 AM, Volker Wysk <[hidden email]> wrote:
>
> > Am Freitag, 12. Januar 2018, 09:08:22 CET schrieb Wade Smart:
> > > On Fri, Jan 12, 2018 at 9:03 AM, Kevin O'Gorman <[hidden email]>
> > wrote:
> > >
> > > > 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.
> >
> > > sudo service mysql start
> >
> > 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
> >
> >
> Thanks.  Useful, I hope, but SHEESH! that mysqld_safe is over 1,000 lines
> of code.  I'll figure out how to use and modify it somehow....

Good luck

Volker


Thanks, but even copying that command line does not work:
  su - mysql -s /bin/sh -c "/usr/bin/mysqld_safe > /dev/null  2>&1 &"
  No directory, logging in with HOME=/

And mysql itself reports
  ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 
But 'service mysql start' works okay.   I'll have to figure out how it does that.  Or just temporarily edit mysqld_safe.




I seem to have solved my own problem.  Some of the stuff that's present and looks germane is actually ignored,
because the code is generic and is designed to work with systems with and without systemd.  The stuff I needed
was in /etc/mysql/mysql.conf/

In particular mysqld.cnf in that directory looks sort of like a script, but is turned into command-line parameters.
I added mine there, and was able to turn off passwords for a bit, and do the cleanup by following instructions

Now I have a working root password again. 

--
Kevin O'Gorman
#define QUESTION ((bb) || (!bb))   /* Shakespeare */

Please consider the environment before printing this email.


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users